API Support Forum
OEC API > API Support > Best way to cancel working orders when closing a position
Author Topic: Best way to cancel working orders when closing a position
(1 messages, Page 1 of 1)
Moderators: VPfau
CKeslin1490
Posts: 4
Joined: Oct 31, 2018


Posted: Apr 20, 2020 @ 03:10 PM             Msg. 1 of 1
What is the recommended best way to cancel existing OCO orders and close a position. Currently, we loop through the orders and cancel any existing order that the IsFinal is set to false, then we place a market order to close the position as in the original OEC example documentation. However, we're seeing orders not cancel and then open a reverse position after the original position is closed by a market order. Any suggestions appreciated.

Cheers,
--Chris