The "issue" below is not really an issue, I am just not sure how to handle it, due to real-time/historical change in logic. I need some of your help.
When a strategy enters into a trade (for example: enter long) in the last bar of the trading session, there is an "issue" the following day, when I disable and enable the strategy.
The issue is that I close the ninjatrader, there is a night time, then I open the ninjatrader in the morning, then I enable the strategy before the market opens.
But the strategy is sending another "enter long" order, the moment I enable the strategy.
It is not clear what happens when I enable the strategy before the market session. Is it historical? realtime? how does the transition happen? on the first tick?
My strategy logic was supposed to assume that when I enable the strategy, the last bar of the previous day will be calculated as historical (enter the trade historically),
and when the next bar open (at market open), it will transition into real-time logic and then will continue the strategy.
From my prints, it shows that when I enable the strategy, the enterlong command comes from historical logic. But if it comes from historical logic, why it sends to the trading platform a real buy order?
Looking forward to your help,
Thank you!
Comment