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

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?
      BertrandNinjaTrader Customer Service

      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()?
          BertrandNinjaTrader Customer Service

          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?
              BertrandNinjaTrader Customer Service

              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 funk10101, Today, 09:43 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post funk10101  
                  Started by pkefal, 04-11-2024, 07:39 AM
                  11 responses
                  37 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Yesterday, 08:51 AM
                  8 responses
                  44 views
                  0 likes
                  Last Post bill2023  
                  Started by yertle, Today, 08:38 AM
                  6 responses
                  26 views
                  0 likes
                  Last Post ryjoga
                  by ryjoga
                   
                  Started by algospoke, Yesterday, 06:40 PM
                  2 responses
                  24 views
                  0 likes
                  Last Post algospoke  
                  Working...
                  X