I am developing a strategy where logic is performed on a higher timeframe and then orders placed using the primary series, and running into an issue with historical order processing (on the chart) and back testing (in Strategy Analyzer) which I cannot figure out.
The strategy adds Daily bars as the second data series and makes it's decisions to trade based on the Daily data. Once an entry is determined, on the close of the first bar of the session of the primary series, the strategy places a Stop Market order.
What is happening is the system is cancelling the Stop Market order automatically on the close of the next primary series bar. I cannot figure out why. This is happening on all different timeframes, 1m, 5m, 30m, etc
Attached is a stripped down version of the strategy that can reproduce the behavior.
Here is some output from the Output Console where I've captured the order updates occurring.
1/18/2023 12:05:00 AM: Entering Long Stop Mkt @ 4028.5, SL = 3996.75, TP = 4024.25. Current Close = 4014.25, High = 4015, Low = 4014 1/18/2023 12:05:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=Submitted instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20' 1/18/2023 12:05:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=Accepted instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20' 1/18/2023 12:05:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=Working instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20' 1/18/2023 12:10:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=CancelPending instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20' 1/18/2023 12:10:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=CancelSubmitted instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20' 1/18/2023 12:10:00 AM - Order update: orderId='NT-00000-612' account='Sim101' name='Long' orderState=Cancelled instrument='MES 03-23' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=4028.5 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2023-01-18 00:05:00' gtd='2099-12-01' statementDate='2023-02-20'
Thank you for your assistance!
-vossom
Comment