The daily bar for MES on 4/16/2020 has high,low of (2748,2699). Yet a stop buy at 2802.5 keeps being ignored by the strat.
Output: (the market is MES)
==entry_SHORT filled. 4/16/2020 5:00:00 PM, Bar245
stopLossBuy=2802.5, Close[0]=2727.5, GetCurrentAsk()=2727.5
4/16/2020 5:00:00 PM Strategy 'aaAutoBREntryStrat/-1': Entered internal SubmitOrderUnmanaged() method at 4/16/2020 5:00:00 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=2802.50 SignalName='sl_SHORT8/7/2021 2:22:44 PM'
Strategy 'aaAutoBREntryStrat/-1': An order has been ignored since the stop price ‘2802.5’ near the bar stamped ‘4/16/2020 5:00:00 PM’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.
4/16/2020 5:00:00 PM Strategy 'aaAutoBREntryStrat/-1': Ignored SubmitOrderUnmanaged() method at 4/16/2020 5:00:00 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=2802.50 SignalName='sl_SHORT8/7/2021 2:22:44 PM' FromEntrySignal='' Reason='Invalid order price, please see log tab'
Log tab:
8/7/2021 2:22:44 PM | Default | Strategy 'aaAutoBREntryStrat/-1': An order has been ignored since the stop price ‘2802.5’ near the bar stamped ‘4/16/2020 5:00:00 PM’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored. |
Should I use "if (stopBuyPrice<=Open[-1]) {}" to check for this possibility? => I tried and you can't access future data with Open[-1].
EDIT2: For now I am sticking with backtest with intraday tick charts, with 1 tick resolution. Backtest on daily bars with 1 min resolution seems wonky for above reason. I bet I am doing something wrong. Any ideas would be appreciated.
EDIT3: This issue occurs on 7000tick chart with 1tick resolution too:
==en_SHORT filled.7/8/2021 12:31:58 PM206
4319=slBuy,ask=4318.75,4318.75=close[0]
7/8/2021 12:31:58 PM Strategy 'aaAutoBREntryStrat/-1': Entered internal SubmitOrderUnmanaged() method at 7/8/2021 12:31:58 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=4319.00 SignalName='sl_SHORT8/7/2021 3:43:09 PM'
Strategy 'aaAutoBREntryStrat/-1': An order has been ignored since the stop price ‘4319’ near the bar stamped ‘7/8/2021 12:31:58 PM’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.
7/8/2021 12:31:58 PM Strategy 'aaAutoBREntryStrat/-1': Ignored SubmitOrderUnmanaged() method at 7/8/2021 12:31:58 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=4319.00 SignalName='sl_SHORT8/7/2021 3:43:09 PM' FromEntrySignal='' Reason='Invalid order price, please see log tab'
Can you comment on if this happens only with back test, or with real time automated trading too? Any help is appreciated.
Comment