Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

      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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Tim-c, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post Tim-c
            by Tim-c
             
            Started by FrancisMorro, Today, 03:24 AM
            0 responses
            2 views
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,770 views
            0 likes
            Last Post Leafcutter  
            Started by Rapine Heihei, 04-23-2024, 07:51 PM
            2 responses
            31 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            945 views
            0 likes
            Last Post spwizard  
            Working...
            X