Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 Freezes when backtesting longer than a few months

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

    NT8 Freezes when backtesting longer than a few months

    Hey there,

    I'm working on backtesting a strategy from February 2022 until February 2023, 1 year. For some reason however, I'm only able to backtest about 5 months before that platform starts freezing and loses connection. It eventually hangs and I have to close it.

    If I go back and backtest each month individually, it works fine. The issue seems to show up when I try to backtest a decently long timeframe.

    Any idea why this would be?

    Also, how would one go about backtesting further back than 1 year ago? Do I have to buy that historical data? I am using a Rithmic data feed connection through a prop firm (Apex) if that helps!

    Thank you
    jaybedreamin
    NinjaTrader Ecosystem Vendor - Zion Trading Algos

    #2
    Hello jaybedreamin,

    This typically means the computer is running out of memory, and starts using the hard drive as memory which is much slower.

    The historical data has to load into memory and all of the orders are stored in memory which can stack up. If there are other objects generated in the script, these also would stack in memory.

    This is a backtest and not a optimization, correct?

    How much memory is available in the Windows Task Manager on the Performance tab when this behavior occurs?

    What bar type and interval is being used?
    Is 1-tick intra-bar granularity implemented? (Or are there additional series added?)
    Is TickReplay on?
    Is Order Fill Resolution set to high?
    Does the strategy place a large amount of trades per day?

    These all impact the memory.


    It may be necessary to test over smaller periods.
    You may want to look into increasing the available system memory on this computer if you are planning to do backtests with large amounts of historical data.


    Historical data can be obtained from a 3rd party if this is not available with your connection and can be imported into NinjaTrader. I am aware of TickData[dot]com, and cqgdatafactory, but there are other historical tick and minute data providers.


    Below is a link to the help guide on importing.
    https://ninjatrader.com/support/help.../importing.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey Chelsea,

      Thanks for the quick response as always. To answer your questions:

      What bar type and interval is being used? 5minute bars with a 1 tick data series added
      Is 1-tick intra-bar granularity implemented? (Or are there additional series added?) Yup
      Is TickReplay on? No
      Is Order Fill Resolution set to high? Order fill resolution is set to Standard
      Does the strategy place a large amount of trades per day? No, right now it is averaging 1.51 trades per day

      I do think you are right that it is a memory issue. I am using a 16GB 2017 Macbook Pro running Parallels to virtualize Windows 10 (virtual pc has 4GB ram)

      I will have to check the available system memory when I run into the issue again. As a workaround I have been backtesting month by month or chunks of months and manually averaging the data, but it is tedious. Need to find a better longterm solution
      jaybedreamin
      NinjaTrader Ecosystem Vendor - Zion Trading Algos

      Comment


        #4
        I increased the ram of Parallels Windows 10 to 6GB from 4GB. Ran the backtest against on a 6 month time period. Looks like it's using about 50% of the available memory, but 100% of the CPU. Is that normal? (Image attached)
        Attached Files
        jaybedreamin
        NinjaTrader Ecosystem Vendor - Zion Trading Algos

        Comment


          #5
          Hello jaybedreamin,

          NinjaTrader is a windows application which relies on the .NET Framework to operate and the .NET Framework is only available on Windows Operating System and is supported only with native Windows PCs.

          Below is a public link to the installation guide for NinjaTrader 8.


          Minimum PC Requirements:
          • Windows 8, Windows 10, Windows 11, or Windows Server 2012 or later with all updates
          • Minimum screen resolution of 1024 x 768
          • 1 gigahertz (GHz) or faster processor
          • 2GB RAM
          • Microsoft .NET Framework 4.8 (pre-installed on most PC's or can be downloaded below)
            Download .NET for Windows 7 and previous here
          NinjaTrader is not compatible natively on a Macintosh computer and is not officially supported to run with virtualization software or cloud services such as Azure or AWS.

          Our support will not be able to assist with the setup of virtualization software or cloud services.

          As a head up, using any virtualization software
          • Will cause a performance and internet latency impact
          • May cause issues with file paths and access permissions
          Using any cloud services
          • May cause issues with identifying logical processors
          • May cause issues with access permissions
          Further, any operating system issues encountered cannot be supported by our support team.

          A Virtual Private Server (VPS) with a dedicated processor count would be recommended instead of using cloud services.

          We also highly recommend using a PC computer which is fully supported, and not using a Mac which is not supported.

          That said, we have had some clients choose to run NinjaTrader on Mac hardware using virtualization software, such as Parallels, VMWare Fusion, and Apple Boot Camp at their own discretion, which will allow running Windows on a Mac.​


          I would recommend using a PC which is supported, without using any virtualization software.

          I would also recommend way way more than 4GB of memory.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello All,
            I have a question is there any possibility to use graphic memory for faster processing of optimization for longer periods?

            My Memory ram is 16 GB but will be extended soon to 32gb; 3200 Mhz fast;
            SSD 512 GB
            And when the optimization is on, for one simple strategy based on one month data, the CPU indicates around 16-30 % of use and memory and SSD is 100%.and sometimes doesn't finish the job at all.

            Do you have any idea how to optimize it? Or maybe sb was using Graphics memory for that?

            Thank you in advace for your support.
            Agni

            Comment


              #7
              Hello Agni,

              Welcome to the NinjaTrader forums!

              Unfortunately, it would not be possible to use the graphics card for strategy processing in the Strategy Analyzer.

              If the memory is showing 100% use, and the hard drive as well, the system has run out of memory and is using the hard drive as memory which has caused the severe impact in performance.
              You will need a system with enough memory for the tests you are running.

              If you are doing optimizations and not backtests, you can take advantage of IsInstantiatedOnEachOptimizationIteration being set to false.
              Hi there, I recently noticed that there may be an issue with memory allocation when running back testing. I noticed that the memory utilisation of my windows
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hello Chelsea,
                Thanks for the reply! I will check that out, but in the mean time I have another question if you could be so kind and help me with it as well​:
                I would like to increase RAM in my computer, and now I have one 16GB stick and I wonder if it will make any difference to instead of adding another 16GB to replace it with one 32GB. I mean having 32GB as one stick is better than having 2x 16GB. Will be any difference in performance while optimizing a strategy to not freeze it out? Hope I've explained myself
                Thanks!​

                Comment


                  #9
                  Hello Rutgnes,

                  I would recommend talking with a PC hardware specialist about this. I would not be able to provide an informed answer about if 1 stick is better than 2.

                  Most importantly would be not running out of memory. IsInstantiatedOnEachOptimizationIteration and IncludeTradeHistory both impact this.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  63 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  139 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  75 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  45 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  50 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X