Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help... NT8 - Strategy Analyzer Crashing

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

    Help... NT8 - Strategy Analyzer Crashing

    Hello,

    When running optimization with the Strategy Analyzer It will start off fine but then around half way through the optimization it will slow down to a crawl and stop working.. When I click to ABORT the process, the resolution of the screen changes and the hour glass starts spinning and Ninjatrader becomes totally unresponsive.
    I then have no choice to do a cntrl-alt delete to bring up the task manger to shut down Ninjatrader and then re-boot the computer... This dosen't happen everytime I go to optimize a strategy but it's doing it enough to where I have to post here in this forum.. But it's happening more and more frequently and getting worse..
    What is it..? Is it my computer..?

    Michael

    #2
    Hello Mykro,

    Likely the issue is the memory is running out.

    The Abort does let the last iteration of the backtest finish which may be stuck due to low memory.

    If the optimization has a large amount of iterations and data I recommend using IsInstantiatedOnEachOptimizationIteration as false to provide a performance increase.

    Below is a link to the help guide.


    Below are links to a few threads where this is mentioned.
    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


      #3
      Chelsea,

      I've increased the page file size but there seems to be no improvement.. The program still crashes.. As far as coding: IsInstantiatedOnEachOptimizationIteration, thats beyond my knowledge of coding.. I'd need to be walked throught that process.. I'm stumped to as why this has just started happening.. When I first installed Ninjatrader 8 last May there was no problem with the program crashing until I had to re-install Ninjatrader sometime last June...

      Michael

      Comment


        #4
        Hello Michael,

        Does this also occur on an optimization with only a few iterations over a week of data?


        IsInstantiatedOnEachOptimizationIteration should be set to false in State.Configure.

        Objects should only be initialized in State.DataLoaded when absolutely necessary, objects that can be reset like arrays should be reset instead of new objects re-initialized.

        May we see an export of the script? I can give a few pointers on where variables should be declared and when they should be initialized / reset.


        To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
        1. Click Tools -> Export -> NinjaScript...
        2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
        3. Click the 'Export' button
        4. Enter a unique name for the file in the value for 'File name:'
        5. Choose a save location -> click Save
        6. Click OK to clear the export location message
        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
        Below is a link to the help guide on Exporting NinjaScripts.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5

          Chelsea,

          FYI.. It dosen't matter what strategy I try to optimzed.. Everytime I go to use the Optimizer Ninjatrader crashes..

          I have attached a file here...

          Michael
          Attached Files

          Comment


            #6
            Hello Mykro,

            Please restart NinjaTrader before testing.

            If you optimize the Sample MA crossover included with NinjaTrader and use:

            Fast 10;11;1
            Slow 25;25;1
            Start date Sept 10, 2019
            End date Sept 16, 2019

            Does this still crash NinjaTrader?

            If so, I would like to schedule a call with you to test these parameters specifically with the Sample MA crossover with you on your end.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Chelsea,

              No.. Those parameters do not crash Ninjatrader...

              Michael

              Comment


                #8
                Hello Mykro,

                This test is to show that when there are few iterations with a small amount of data the optimization may complete because the memory is not running out.

                HMAVMACrossOver doesn't appear to have any variables holding objects that need to be reset or re-initialized.

                Try setting IsInstantiatedOnEachOptimizationIteration to false in State.Configure. This should improve the performance of optimizations and should allow for a larger iterations in the optimization.

                One suggestion would be to prevent the drawing objects from being created and saved in memory when the window is a Strategy Analyzer.
                https://ninjatrader.com/support/foru...58#post1070958

                Drawing objects do get created and saved in memory even when backtesting or optimizing and do cause a performance hit.
                Last edited by NinjaTrader_ChelseaB; 09-17-2019, 10:26 AM.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea,

                  Do I need to check each strategy I create and make sure that: IsInstantiatedOnEachOptimizationIteration in State.Configure is set false then..?
                  I am curious as to why this has just started happening.. Is this a memory leak in C#..??

                  Michael

                  Comment


                    #10
                    Hello Mykro,

                    We are not aware of any memory leak. But if one can be proven we can send the steps to reproduce the development team.

                    You may be testing different data or settings and different iterations and getting different behavior.

                    Yes, you would want to set IsInstantiatedOnEachOptimizationIteration to false in State.Configure for any strategy that you would like to take advantage of the performance increase with. Each strategy must be coded properly with variables that needs reset and re-initialization should it have those type of variables.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Chelsea,
                      As you have probably guessed.. I know very little about coding.. All of you in Tech support are knowledable in this regard. Therefore, I need to get up to speed on C# now that I own a license key.. Can you or someone over there recommend a good beginners/intermediate book on C# ?... Please...

                      Comment


                        #12
                        Hello Mykro,

                        Below I am providing a link to a forum post with helpful information about getting started with NinjaScript.


                        You may try a google search for beginner C#.

                        A few community members has told me the NinjaScript Programmer's Launchpad, a book written by a community member, may be helpful.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Hello Chelsea,

                          I tried to set IsInstantiatedOnEachOptimizationIteration to false but I have to unlock the code to do that, and then I'm locked out of Stategy Builder to edit what I wrote..(am I missing something)..?? I'm always building new Strategies and putting them through the Analyzer to test.. I'm back and forth, in and out of the Analyzer constantly tweaking the parameters...
                          Is there any other way to improve the memory..?
                          Also Market Replay crawls along too.. 500X crawls along as if it was 30X speed..
                          I'm at my wits end.. I just don't enough about it.. I'm getting to the point where I cringe just opening up Ninjatrader.. I need your help...

                          Thanks
                          ​​​​​​​​​​​​​​Michael

                          Comment


                            #14
                            Hello Michael,

                            I'm not aware of any other way of reducing memory requirements of a script during optimization.

                            Yes, setting IsInstantiatedOnEachOptimizationIteration to false is advanced and does require unlocking the script.
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by frslvr, 04-11-2024, 07:26 AM
                            9 responses
                            123 views
                            1 like
                            Last Post caryc123  
                            Started by rocketman7, Today, 09:41 AM
                            4 responses
                            15 views
                            0 likes
                            Last Post rocketman7  
                            Started by selu72, Today, 02:01 PM
                            1 response
                            9 views
                            0 likes
                            Last Post NinjaTrader_Zachary  
                            Started by WHICKED, Today, 02:02 PM
                            2 responses
                            16 views
                            0 likes
                            Last Post WHICKED
                            by WHICKED
                             
                            Started by f.saeidi, Today, 12:14 PM
                            8 responses
                            21 views
                            0 likes
                            Last Post f.saeidi  
                            Working...
                            X