Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

System Crashing when Optimizing in Strategy Analyzer

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

    System Crashing when Optimizing in Strategy Analyzer

    Hi,

    I've been backtesting and optimizing some strategies I've coded. I've run hundreds of simulations using ticks charts and everything was fine so far. For this particular strategy I wanted to look the behaviour over many time frames (1 min, 2 min, 5 min, 10 min, etc)

    For some reason when I try to run an optimization over the 1 min series the systems just crashes. RAM usage skyrocketed and I had to force the restart of my laptop.

    When I tried the optmization over the 2 min series something similar happened but this time with the last simulation, as observed in the picture attached. NInja does not finish the simulation nor generate the log in the analyzerlog folder.

    I'm totally lost here since its the same code that has been running for the ticks based series.

    I would appreciate some light over this issue,

    Thanks in advance,

    #2
    We will see what NT says, but I've had the same problem and it turned out to be a couple of things for me:

    1. If you are adding objects without deleting them, then that explains the memory usage. I was drawing up and down arrows over the whole chart and the strategy analyzer was creating millions of them without deleting them apparently. Removing them helped a lot.

    2. To a lesser degree, if your strategy adds indicators to the chart, it uses more memory.

    Both of these things use up memory and slow down the analyzer. I ended up adding a bool option to "show indicators" and just turn it off when I'm optimizing. Then when I get the results, I open the individual runs in another tab, turn on the show indicators switch, and I can see all my indicators and arrows, etc.

    Good luck.

    Comment


      #3
      Hello AlejoSar87,

      Thank you for your post.

      linuxguru has some very valid point here. Does the strategy add any drawing tools to the chart such as up or down arrows as they suggested?

      How many parameters are you optimizing on?

      How many days are you running the strategy over?

      Do you receive any errors in the log panel of the Control Center? If so, what is the full text of the error(s)?

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

      Comment


        #4
        Thanks linuxguru and NinjaTrader_Kate for those quick answers. I disabled all grafic elements my strategy was adding to the charts and it ran optimization spectacularly in 1 min and 2 min series. For tick series also reduced the time to perform the calculations considerably. Thank you so much. Never occured to me that these arrows could cause me so much trouble.

        Since Kate asked, I will say that my strategy is only optimizing 2 parameters (500 simulations aprox) over a period of a whole year. Do you think that could be too much? It's only taking between 5 min and 10 min to complete each optimization now.

        Comment


          #5
          Hello AlejoSar87,

          Thank you for your reply.

          It does seem that your drawing objects that your strategy was creating were the culprit there. 2 parameters isn't an unfeasible number to optimize on, nor is over a year, but when you think about how many times your strategy creates individual drawing objects over the course of that year you can likely see where things might get bogged down. 5 to 10 minutes isn't at all an unreasonable time to complete an optimization - with more complicated ones they could take hours. I'd say you're good to go now after disabling the graphical elements.

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

          Comment


            #6
            AlejoSar87 to give you some context, I have optimized over 10 years of 1 min data with 10s of parameters to optimize over days (millions of simulations). The fewer objects you draw, the faster it goes with less memory used.

            Good luck with your trading.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mestor, 03-10-2023, 01:50 AM
            16 responses
            388 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            31 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by yertle, Yesterday, 08:38 AM
            7 responses
            29 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by bmartz, 03-12-2024, 06:12 AM
            2 responses
            22 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by funk10101, Today, 12:02 AM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Working...
            X