A cancelled order triggers BarsSinceEntryExecution to increment by 1, going from BarsSinceEntryExecution: -1 to BarsSinceEntryExecution: 0
See below debug prints:
15/12/2023 00:06:00 Strategy 'UnmanagedTemplate/-1': Entered internal SubmitOrderUnmanaged() method at 15/12/2023 00:06:00: BarsInProgress=0 Action=SellShort OrderType=StopLimit Quantity=1 LimitPrice=4767.00 StopPrice=4766.75 SignalName='Short limit entry'
15/12/2023 00:06:00 Strategy 'UnmanagedTemplate/-1': Entered internal SubmitOrderUnmanaged() method at 15/12/2023 00:06:00: BarsInProgress=0 Action=Buy OrderType=StopLimit Quantity=1 LimitPrice=4769.50 StopPrice=4769.75 SignalName='Long limit entry'
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: -1
15/12/2023 00:07:00 Strategy 'UnmanagedTemplate/-1': Cancelled custom managed order: orderId='NT-00001-743' account='Backtest' name='Long limit entry' orderState=Working instrument='MES MAR24' orderAction=Buy orderType='Stop Limit' limitPrice=4769.5 stopPrice=4769.75 quantity=1 tif=Gtc oco='29/02/2024 00:08:08System.Int32[]entry' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-12-15 00:06:00' gtd='2099-12-01' statementDate='2024-02-29'
15/12/2023 00:07:00BarsInProgress: 0 currentbar: 6 BarsSinceEntryExecution: 0
Any ideas why this is happening?
Thanks you
Comment