Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest consumes too much RAM crashing the system

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

    Backtest consumes too much RAM crashing the system

    Hi everyone,

    Reasonably new to backtesting.

    Some of my tests, even with limited amount of iterations (400) seem to consume a ton of RAM (I have 24GB). Sometimes the system seems to be able to page some to HDD and continue, but most times everything crashes.

    Are there any solutions (even outside of NT, like paging file size or... i don't know ) that i can apply to make sure my tests complete succesfully without crashing?

    Thanks in advance.

    G

    #2
    Hello gabmit1,

    Thank you for your post.

    Are you doing a backtest, or an optimization? It seems like you may be referring to an optimization.

    Computer memory is important for long resource-intensive tests that generate a large number of trades without your machine stalling. Computer processor speed is important to get optimization iterations done quickly and the number of CPU cores allows for more iterations to run simultaneously.

    We should consider the following for memory consumption:

    Data * Strategy resources * Number of backtest/optimization iterations * Number of trades * Keep best # of results (when optimizing).

    With more complex code can come heavier calculations which may require more processing. This is further impacted by the amount of data being processed, the number of iterations in the optimization, and amount of new objects being created in each iteration.

    It is important to note that the Tick Replay property implies that more PC resources are used to calculate your indicators and strategies also and as a result will lead to a performance impact. This is noted on the Tick Replay and Performance Tips help guide pages below.

    Tick Replay:https://ninjatrader.com/support/help...ick_replay.htm

    Performance Tips:https://ninjatrader.com/support/help...ance_tips2.htm

    We also have this forum post which goes into more detail about things in your script that can affect optimization performance:



    To improve backtests/optimization, you could reduce the amount of days being tested over to reduce the data being processed. You could also reduce the number of iterations by reducing the range of optimized parameters when running an optimization.

    Optimization Tips —https://ninjatrader.com/support/help...ionPerformance

    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    58 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    39 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    19 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    20 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    50 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X