I have a strategy that I backtest on multiple days, which holds positions overnight. I backtest the strategy using tick data, and exit on close = false. Products used: GC and SI futures bid-ask-last.
If I backtest with a sessionthat stops before midnight, the strategy works fine, I can backtest 5 days in a row.
If I backtest using session 24/5 or instrument template (which is also over midnight), NT stops the simulation at 23:59:59 of the first day and liquidates the strategy. The liquidation does not come from my strategy, here is the stacktrace to Ontermination:
at NinjaTrader.Strategy.BaseStratCode.OnTermination() in c:\Users\......... at NinjaTrader.Strategy.StrategyBase.EnsureLifeTimeStatus(LifeTimeStatus status) at NinjaTrader.Strategy.StrategyBase.RunBackTest() at NinjaTrader.Strategy.StrategyAnalyzer.RunBackTestInWorkerThread(Object state) at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
Comment