I am trying to implement a reversing strategy using atm's. I created an atm with twice the share amount of the currently active trade, and when the market hits my stop/limit order on the reversing ATM order, it will reverse my position by entering the market with 2 times the shares in the opposite direction thereby reversing my trade.
The problem is, once the reversal trade happens, I have left over stop/target orders from the previous trade that cannot be canceled within NinjaScript. ATMStrategyClose() does not help because it does not realize that the original position shares have been exited, and it tries to close the original order by moving the original target to get executed at market, which now erroneously doubles my position in the opposite direction.
Once my order is reversed, I would like to simply cancel the stop/target orders of the original position. Is there any way to cancel the stop/target orders of an atm strategy in NinjaScript?
Comment