Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 04:16:00 +0000



Post From: Advanced Study: using both Attached Orders and BuyExit/SellExit

[2014-03-31 18:17:23]
User24178 - Posts: 4
In the presence of Attached orders, though, the system would have to cancel some of them to account for the decrease in the position size, is that correct?

Please see the attached trading log that shows a position of 10000 GBPUSD, with open Stop Loss and Take Profit Buy orders. In this situation, my study tries to close the position using code like this:

s_SCNewOrder NewOrder;
NewOrder.OrderQuantity = 10000; // full position size
NewOrder.OrderType = SCT_MARKET;

int quantity = sc.SellExit(NewOrder);

The result is

Auto-Trading: GBPUSD 1 Min #1 | Move Retracement | SellExit signal is ignored because Short position quantity does not exist or there are already working exit orders that will flatten the position. Current Position quantity with working exit orders: 0. Current Position quantity with exit market orders: 0 | 2014-03-31 13:18:02

Can you advise on the proper way to force-close a position like this?
Would it help if I cancelled the attached orders first?

Thank you.

Private File