I issue an associated "sell stop market" order by: " ExitLongStopMarket(1, currentPrice - stopLossGAP*2 , "Market_Sell_Stop_Loss", "limit_Long_Entry");".
However, this "sell stop market" order issued by "ExitLongStopMarket" is being almost immediately cancelled with no apperant reason.
tracking the lifecycle of the order using Prints, together with a message printed in the event handler "OnOrderTrace" (marked below with *) result with the following text:
2024-10-25 19:10 - Market_Sell_Stop_Loss state is: Submitted
2024-10-25 19:10 - Market_Sell_Stop_Loss state is: Accepted
2024-10-25 19:10 - Market_Sell_Stop_Loss state is: Working
* Strategy 'MyCrossOverRunningAvg20241020/341392136': Cancelled expired order: BarsInProgress=0, orderId='NT-00022-144' account='DEMO3323639' name='Market_Sell_Stop_Loss' orderState=Working instrument='MES DEC24' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=5874.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2024-10-25 19:10:30' gtd='2099-12-01' statementDate='2024-10-26'
2024-10-25 19:11 - Market_Sell_Stop_Loss state is: CancelPending
2024-10-25 19:11 - Market_Sell_Stop_Loss state is: CancelSubmitted
2024-10-25 19:11 - Market_Sell_Stop_Loss state is: Cancelled
Will appreciate ideas what might be the source of the order forced cancelling.
Thanks

Comment