Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Over Midnight tick data - strategy liquidation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Over Midnight tick data - strategy liquidation

    Hi,

    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:

    Code:
       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)
    ???????????????????

    #2
    benoirat, thanks for the report benoirat - would this happen only for backtesting this custom strategy or would you see it on this template as well for those instruments on our SampleMACrossOver script?

    Would you mind contacting us via Help >> Mail to Support so we could review log / traces from this setup?

    Comment


      #3
      Mailed,

      I hope this will help. In the meantime creating a session that stops just before and starts just after midnight enables me to backtest.

      I did try a built in strategy on GC and it did run overnight on the 24/5 session though

      Comment


        #4
        Thanks, will check into it. If the default scripts worked fine, would then suggest isolating out what parts break this part in your custom script.

        Comment


          #5
          Will try that out yes. Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          22 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          24 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-25-2026, 09:53 PM
          0 responses
          30 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 03-25-2026, 09:51 PM
          0 responses
          18 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 03-23-2026, 11:13 AM
          0 responses
          27 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X