Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reload NinjaScript

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

    Reload NinjaScript

    I am developing some custom indicators and a strategy, and need to troubleshoot some behaviour that's unwanted.

    When I initially enable the strategy, some of my indicators plot OK, but others don't. When I then "reload NinjaScript" (with the strategy still enabled) all indicators then plot fine.

    So prior to "Reload NinjaScript" some indicators don't seem to plot correctly. After "Reload NinjaScript" they do ... And BTW, there are no "Try/Catch" type errors showing up in the log, so I don't think it's related to an error ...

    So, what does "Reload NinjaScript" actually do? Understanding this better may help me isolate the problem.

    Thanks.

    #2
    Originally posted by AnotherTrader View Post
    I am developing some custom indicators and a strategy, and need to troubleshoot some behaviour that's unwanted.

    When I initially enable the strategy, some of my indicators plot OK, but others don't. When I then "reload NinjaScript" (with the strategy still enabled) all indicators then plot fine.

    So prior to "Reload NinjaScript" some indicators don't seem to plot correctly. After "Reload NinjaScript" they do ... And BTW, there are no "Try/Catch" type errors showing up in the log, so I don't think it's related to an error ...

    So, what does "Reload NinjaScript" actually do? Understanding this better may help me isolate the problem.

    Thanks.
    Further to the above, does "Reload NinjaScript" re-run all Initialize(), OnStartUp(), OnBarUpdate(), etc methods in the same way that they are run when "enabling" a strategy?

    And also, the effect seems to be different if I enable from the Control Center's Strategy tab (which is where I get the behaviour observed above) versus enabling from the chart's strategy window (where the indicators all load perfectly first time)... any ideas what this might be?
    Last edited by AnotherTrader; 02-13-2013, 06:59 AM.

    Comment


      #3
      Correct, it would rerun through those methods - basically creating / applying a fresh instance of the script you're running. Are you running a single or multi series script here where you see issues?

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        Correct, it would rerun through those methods - basically creating / applying a fresh instance of the script you're running. Are you running a single or multi series script here where you see issues?
        Hi, Bertrand
        The script is multi-series, but the observed behaviour still occurs even when I completely comment out any code not related to series 0.

        Comment


          #5
          Thanks, so you commented out the adding of the series itself as well under Initialize()?

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            Thanks, so you commented out the adding of the series itself as well under Initialize()?
            Yes, commented out Add(), and OnBarUpdate processing for the additional BarsInProgress, and any DataSeries referencing other than series 0.

            Comment


              #7
              Ok, thanks.

              Would you see this as well when replacing the indicator calls by standard NT indicator methods, such as the SMA or RSI?

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                Ok, thanks.

                Would you see this as well when replacing the indicator calls by standard NT indicator methods, such as the SMA or RSI?
                If I replace custom indicator by SMA, then the indicator plots correctly immediately upon enabling within the Control Center strategy tab (as opposed to requiring a "Reload NinjaScript" before plotting correctly).

                Comment


                  #9
                  At this point, I'd suggest doing some additional debugging and stepping through each state of your custom indicator to determine exactly what value is changing before and after it is reloaded. You can always do this by using print statements, but for this type of debugging, you may consider using Visual Studio for more advanced debugging.

                  Here is a quick video that walks you through debugging of our ADX indicator:



                  Written instructions for the setup can be found here:



                  Please feel free to share your results with this thread or let us know if we can help clarify any of your findings.
                  MatthewNinjaTrader Product Management

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  558 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  545 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  547 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X