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 argusthome, 03-08-2026, 10:06 AM
          0 responses
          71 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          43 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          25 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          28 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          56 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X