I've not seen this before but right now I have an NT8 (v19) strategy which can produce an order that is not cancellable. Literally calling CancelOrder(order) doesn't do anything. I've built a lot of printout to the Output Window to monitor it. You can see multiple attempts over multiple bars are not cancelling the order named "LE".
31/10/2019 1:30:00 AM GoLong()
31/10/2019 1:30:00 AM Long limit order at entry price 3032.25
31/10/2019 1:30:00 AM Strategy 'tzMomentumStrategy/180132578': Entered internal SubmitOrderManaged() method at 31/10/2019 1:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=3032.25 StopPrice=0 SignalName='LElmt' FromEntrySignal=''
+ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
31/10/2019 2:00:00 AM OnBarUpdate() closeDirection 1 tradeDirection 1 momValue 6 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
31/10/2019 2:00:00 AM OnBarUpdate() doing trade 1
31/10/2019 2:00:00 AM MyCancelAllOrders(True,True)
Cancelling LE
+ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
31/10/2019 2:30:00 AM OnBarUpdate() closeDirection -1 tradeDirection -1 momValue -9 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
31/10/2019 2:30:00 AM OnBarUpdate() doing trade -1
31/10/2019 2:30:00 AM MyCancelAllOrders(True,True)
Cancelling LE
+ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
31/10/2019 3:00:00 AM OnBarUpdate() closeDirection -1 tradeDirection -1 momValue -2 momValid = True; doExit=False, doTrade=True allOrdersInactive=False
31/10/2019 3:00:00 AM OnBarUpdate() doing trade -1
31/10/2019 3:00:00 AM MyCancelAllOrders(True,True)
Cancelling LE
+ActiveOrders LE,LS,LT: True Working,False Filled,False Cancelled,+ SE,SS,ST: False Filled,False Filled,False Cancelled
This brings the trading to a stop because the strategy is permanently waiting for all orders to be cancelled before doing its next step.
FYI when the log says "Cancelling LE" the immediate next piece of code is
CancelOrder(LE.order)
LE is a class which contains various bits of information, including theOrder object.
Assistance requested.
Thanks,
saltminer
Comment