- Hello, we have an strategy generated by SQ running on NinjaTrader. When we run the strategy in backtest, pending orders live one bar more than in the real market or in simulation. For instance, if we have a maximum of 11 bars for the pending order, then in backtest the pending order gets cancelled at the eleventh bar but in the real marked it gets cancelled at the tenth bar. How can this be possible? Is there any possible workaround?Thank you.
Not sure what could cause this. Maybe it has something to do with “evaluate on bar close”. So in live/sim the order is deleted while the bar is being created but in backtest it’s evaluated once bar closes … that’s why there is 1 bar increment
See here “Running a Strategy at the Close of a Bar or Tick by Tick”
¢ During backtest, strategies can ONLY be processed at the close of each bar
¢ During real-time operation, you have a choice to run a strategy tick by tick (CalculateOnBarClose set to false) which can produce different results
You must be logged in to reply to this topic.