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

Optimization and NinjaTrader performance

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

    Optimization and NinjaTrader performance

    I recently got a new computer to use for optimization testing. It's got 8 - 3.7 Ghz cores and 16 GB of RAM. I am using the latest NT 8.0.21.1 64 bit. I am not doing anything crazy with my optimization iterations - usually testing 2 parameters, and keeping the number of iterations of tests under 200, over a 6-12 month period. The first test runs really fast, but any test after that hangs until I restart NinjaTrader. I find that I need to restart NinjaTrader after each optimization test. The memory usage spikes really high and doesn't go down.

    Any ideas?
    Last edited by szayedoud; 05-21-2020, 08:27 PM.

    #2
    Hello szayedoud,

    Thank you for your post.

    Does the strategy that you're optimizing create any drawing objects on the chart? Drawing objects can often be problematic when backtesting or optimizing a strategy as the optimization process creates them rapidly and this can become a strain on memory. If the strategy does print drawing objects to a chart, the first thing I would do is disable those for the optimization.

    I would also look at IsInstantiatiatedOnEachOptimizationIteration:



    The default behavior is to re-instantiate the strategy for each optimization backtest run. However, the process of re-instantiating a strategy requires more time and computer resources to return results, which could impact the amount of time it takes to run an optimization. When IsInstantiatedOnEachOptimizationIteration is false, the strategy is re-used to save time and computer resources. If you choose to take advantage of the performance benefits during strategy optimization by setting the IsInstantiatedOnEachOptimizationIteration property to false, any objects you create in your code MUST be reset during the appropriate State within the OnStateChange() method.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      I did have IsInstantiatiatedOnEachOptimizationIteration set to true, and now it's set to false. It is not making a difference - my optimization tests still hang after the first run. And even though I have a few indicators, none of them are being set on the chart through the "AddChartIndicator" method. NinjaTrader still spikes the memory usage (over 90%) and often is "Not Responding" in Task Manager.

      With my recent attempt, the first run is relatively quick (within a minute). Repeating the same test hangs for significantly longer (maybe 10 minutes). It does finish, but NinjaTrader remains to be slow and the memory is still very high. It's not releasing the memory. It sounds like a memory leak. I have to restart NinjaTrader for it be usable

      Comment


        #4
        Hello szayedoud,

        Thank you for your reply.

        I'd like to test the behavior on my end to see if it may be an installation issue or something in the strategy itself that may be causing the memory usage to increase. Would you be able to provide the strategy you are using? If you are not comfortable posting it here, you can email it to us directly at platformsupport [at] ninjatrader [dot] com. If you email the file, please include "2568136 ATTN Kate W." in the subject line.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        7 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X