I'm testing a strategy on daily bars in the Strategy Analyzer and have encountered a strange situation where a market entry order doesn't get filled. (The situation occurs on a huge doji bar during extreme volatility.)
I use the managed approach with entry orders "Live until cancelled" and assign the entryOrder in OnOrderUpdate() to ensure the assignment occurs when expected according to "SampleOnOrderUpdate". The issue seems to be that the entry order gets stuck in orderState=Working and never reaches orderState = filled. No error message is thrown to the log.
How can I solve this issue?
The entry order is submited on the close of Friday 2020-03-20 and would be expected to be filled on the Open on Monday 2020-03-23.
OnBarUpdate()
Time[0]: 2020-03-20 22:00:00 | CurrentBar: 306
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
Position.MarketPosition: Flat
(entryOrder == null): True
2020-03-20 22:00:00 Strategy 'akBasicExitSignalsStrat/-1': Entered internal SubmitOrderManaged() method at 2020-03-20 22:00:00: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='LongBaseLine_306' FromEntrySignal=''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OnOrderUpdate()
Time[0]: 2020-03-20 22:00:00 | CurrentBar: 306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OHLC: 2409,75 | 2557,75 | 2318,75 | 2347,25
order.ToString(): orderId='NT-00099-568' account='Backtest' name='LongBaseLine_306' orderState=Submitted instrument='ES SEP23' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-03-20 22:00:00' gtd='2099-12-01' statementDate='2023-08-27'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OnOrderUpdate()
Time[0]: 2020-03-20 22:00:00 | CurrentBar: 306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OHLC: 2409,75 | 2557,75 | 2318,75 | 2347,25
order.ToString(): orderId='NT-00099-568' account='Backtest' name='LongBaseLine_306' orderState=Accepted instrument='ES SEP23' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-03-20 22:00:00' gtd='2099-12-01' statementDate='2023-08-27'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OnOrderUpdate()
Time[0]: 2020-03-20 22:00:00 | CurrentBar: 306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OHLC: 2409,75 | 2557,75 | 2318,75 | 2347,25
order.ToString(): orderId='NT-00099-568' account='Backtest' name='LongBaseLine_306' orderState=Working instrument='ES SEP23' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-03-20 22:00:00' gtd='2099-12-01' statementDate='2023-08-27'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
OnBarUpdate()
Time[0]: 2020-03-23 22:00:00 | CurrentBar: 307
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
Position.MarketPosition: Flat
(entryOrder == null): False
entryOrder.OrderState: Working
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
OnBarUpdate()
Time[0]: 2020-03-24 22:00:00 | CurrentBar: 308
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
Position.MarketPosition: Flat
(entryOrder == null): False
entryOrder.OrderState: Working
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
OnBarUpdate()
Time[0]: 2020-03-25 22:00:00 | CurrentBar: 309
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++
Position.MarketPosition: Flat
(entryOrder == null): False
entryOrder.OrderState: Working

Comment