Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting much slower on NT7 versus NT6.5

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

    Backtesting much slower on NT7 versus NT6.5

    Hi there,

    For my specific purposes, back-testing on NT7 is MUCH slower than previously on NT6.5. I'm talking about a difference of... 5? 10? times slower. (I haven't done precise timing tests, but that's the rough order of magnitude.)

    I'm not expecting anyone at NT to look at my code, or re-write NT7 for my sake. I'm just trying to understand where the issues might be, so I could possibly change my own code around.

    The backtest consists of one primary bar (30m), and 3 secondary bars of the same instrument (1m, 5m, 30m). Now, for every iteration through a bar... it's possible I place multiple orders (up to 20). Other than that, I'm just scrolling through about 2-3 months of data at a time. I don't use any indicators.

    On NT6.5, this back-testing might take 5-10 minutes. Right now, the same data-set + instruments on NT7 is easily taking 25-50 minutes.

    Any suggestions on what might be different?

    #2
    Alternatively, any suggestions on profiling tools that I can use on both 6.5 and 7 to figure out where the time is being spent?

    Comment


      #3
      Hello,

      Thanks for the note.

      Please go into Control Center->Tools->Options->Data Tab and click the option to save chart data as historical so you dont have to go to the data feed provider and download the historical data each time you do a backtest. This may be whats going on. You can also try disconnecting from feed provider and running the test. What does time look like now?

      Overall though NT7 uses multi threaded technology with backtesting, NT7 should be much fast in backtesting then 6.5 ever was especially if you have a multi threded CPU so I am surprised to see your post. Please check the above to see if this isn't where the extra time is coming into play.

      No suggestion of profiling tools unfortunately. Other then printing system times to the output window at the start and completion of methods.

      I look forward to assisting you further.
      BrettNinjaTrader Product Management

      Comment


        #4
        Hi,

        No, I'm familiar with that "quirk" in back-testing... and I always load historical data, and then disconnect from the data provider before continuing. I do so on both 6.5 and 7. Whatever is happening is independent of that.

        There must be something else going on... I know for example the output window is now being updated by a worker thread mid-backtest, which wasn't being done before. But that's not the scenario in which case its running slow, so it's not running slow due to that...

        Comment


          #5
          By the way, I also use lock() throughout my code... for synchronization reasons. So, multi-threading probably doesn't help me a whole heck of a lot.

          Is there any reason to think the new multi-threaded model will be *slower* than the previous single-thread back-testing engine..? Especially if much of it will be held up by a lock?

          Comment


            #6
            Hello,

            Its very possible.

            What are you locking? Is it something for tracking or needed for the backtest for file access? How hard is it to try commenting these locks out?

            Or you posting anything to the Log()? I've seen where if you call Log() too many times this will slow NT down.

            Also, please verify its the strategy. Can you please run a backtest of sampleMACrossover on the same data series. How much time does this take to complete and I will compare with my side to make sure that we can isolate this to something in the strat.

            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            662 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            376 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X