I have a add-on thats opens an ATM Strategy:
string entry_name = "Entry"; Order order = Account.CreateOrder(Instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Automated, cbxTif.SelectedTif, quantityToExecute, 0, 0, oco, entry_name, gtd, customOrder); AtmStrategy.StartAtmStrategy(cbxStrategySelector.SelectedAtmStrategy, order);
After open a LONG position with this strategy, the stop loss automatically enters 3 ticks bellow. So far so good.
With this code, I can close the opened position:
Order order = Account.CreateOrder(Instrument, OrderAction.Sell, OrderType.Market, OrderEntry.Automated, cbxTif.SelectedTif, quantityToExecute, 0, 0, oco, "Sell", gtd, customOrder); Account.Submit(new[] { order });
How can I invert or close a position openned with an ATM Strategy, and all the limit/stop ordens from that strategy also be closed in a smart way?
Thanks
Comment