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

Crash during optimization

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

    Crash during optimization

    MACombine.zip
    I am new to nt 8, I found I always crash during optimization of some simple strategy like macrossover.

    Is it related to my pc config or my strategy?

    PC config:
    CPU: i5 7200U
    RAM: 12GB

    Thanks.


    #2
    Hello heiheilau2000,

    Thank you for your post.

    There are several factors that need to be considered with optimizations. By nature, they are brute force operations and they will use all of the CPU and memory resources they can. When memory is fully consumed, there will be slight stalls when garbage collection decommits memory and new resources are committed to memory to continue the optimization.

    Please see the video created by my colleague demonstrating how the SampleMACrossover strategy, a simple strategy that utilizes IsInStantiatedOnEachOptimizationIteration=false for efficiency, can still quickly utilize memory resources.

    Demo — https://drive.google.com/file/d/15pz...w?usp=drivesdk

    We should consider the following for memory consumption:
    Data * Strategy resources * Number of optimization iterations * Number of trades * Keep best # of results.

    As we can see there are a number of factors that are involved and memory utilization can climb very quickly depending on a few of these factors. Once memory gets maxed out, we can experience short freezes where memory is decommitted, stored to disk, and then new resources are committed before the backtest is resumed.

    We can easily control the number of iterations involved and we can also consider writing our strategies to use IsInstantiatedOnEachOptimizationIteration = false; (Which requires that we reset class level variables in State.DataLoaded.)

    See the help guide documentation below for more information.
    IsInstantiatedOnEachOptimizationIteration — https://ninjatrader.com/support/help...niteration.htm
    Optimization Tips — https://ninjatrader.com/support/help...ionPerformance
    Walk Forward Optimization — https://ninjatrader.com/support/help...ss_metrics.htm
    Genetic Optimization — https://ninjatrader.com/support/help..._algorithm.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Skifree, Today, 03:41 AM
    0 responses
    1 view
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    23 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    22 views
    0 likes
    Last Post Pattontje  
    Working...
    X