Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting Problems with Version 7 beta 21

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

    Plotting Problems with Version 7 beta 21

    My indicator plots are no longer shown correctly within the strategy analyzer. Prior to beta 21, I could back test an instrument with a strategy and click from symbol to symbol, and the indicator plots were shown each on their own line. Now all the plots lie on top of one another. However, if I back test a single symbol, the indicators are displayed correctly. I have tried uninstalling and reinstalling to no avail.

    Do you have any ideas?

    #2
    rocketman, I already replied to your other post, but let's keep the discussion in this thread because it was started by you. In the future, please only post your question/inquiry just once.

    I will ask the same question: can you please post a screenshot of this behavior so we can see exactly what is going on?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Images

      Sorry. I have been having trouble posting my questions. Here are two images, showing the problem, and a normal plot.
      Attached Files

      Comment


        #4
        rocketman75,

        In that indicators code, please check to see if there is a line in the Initialize() method like this one:
        Code:
        Overlay = true;
        If there is you can either set that to false and it will not overlay onto the price panel, or you can go to the strategy code and actually force it to a different panel when you do Add(). To choose the panel of an indicator you Add() you can see this tip: http://www.ninjatrader.com/support/f...ead.php?t=3228
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Plotting problems

          I will try your suggestion, but the solution is NOT satisfying even if it works. The two images i sent you were produced by the same strategy, using the same indicators. The only difference was that the incorrect (overlayed) image was produce when back testing a group of ETF's, and the correct image was produced by back testing a single ETF. Both images looked identical under beta 20. What has changed under beta 21 that produced the overlayed images?

          Comment


            #6
            Without actually seeing code we cannot comment on what is expected and what is not for your particular scenario.

            For sure there has been changes which would "appear" to cause issues like the above simply because the old implementation was simply wrong. If it worked before on the wrong implementation it could simply have "worked" because of some wrong relationships back in B20 and as such, moving forward, would require correct changes to code/etc. to match the new implementation.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Plotting problems

              O.K. The suggestion worked. Here's the previous code snippet and the changes:

              CustomMAMA(false,deadbandFactor,famaScale,fastLimi t,0.075).AutoScale = true;
              Add(CustomMAMA(false,deadbandFactor,famaScale,fast Limit,0.075));
              //CustomMAMA(true,signalDeadBandFactor,signalFamaSca le,signalFastLimit,signalFastLimit*0.1)
              CustomMAMA(true,signalDeadBandFactor,signalFamaSca le,signalFastLimit,signalFastLimit*0.1).AutoScale = true; // added this line because the price plot is not Auto scaling correctly
              Add(CustomMAMA(true,signalDeadBandFactor,signalFam aScale,signalFastLimit,signalFastLimit*0.1));

              AdaptiveDStochasticWithDivergence(20,3).Panel = 1; // added line
              Add(AdaptiveDStochasticWithDivergence(20,3));

              iTrend(longCyberAlpha).Panel = 2; // added line
              Add(iTrend(longCyberAlpha));
              AOZLag(aoShortLength,aoLongLength).Panel = 3; // added line
              Add(AOZLag(aoShortLength,aoLongLength));

              Even after applying the changes above, the price plot (Panel 0) no longer autoscales properly. The original plot appears correct, but as soon as I scroll it back in time, it changes. Now the minimum value is zero (see enclosed file). This is a new problem as well.
              Attached Files

              Comment


                #8
                Plotting problems

                I have further analyzed older strategies that I have written, and I think you are correct. I have met the enemy and he is me. I guess that proves just because it compiles and runs doesn't mean its right.

                The enclosure contains the initialize() method that seems to be causing the problem. I wanted to have a single strategy that contained several preinitialzed parameter sets optimized for different instrument classes. I use the strategy to scan the markets for trading opportunities.

                I actually have the if-then-else block in the code twice, once in the initialize method and once in the OnBarUpdate() method, protected by the logical variable areParametersInitialized such that the code only runs once. Strategies that do not have this code seem to plot correctly, and ones with it do not plot correctly.

                I am presuming that the code enclosed is "bad programming practice".

                Do you have a suggestion of some other way to achieve the same result?

                Thanks for your help.
                Attached Files

                Comment


                  #9
                  rocketman75,

                  The issue with the attempt you are trying is that it should be noted that Initialize() can be called several times so you likely should not lock it to running only once in Initialize(). There would likely be no need to call it in OnBarUpdate() since once you reach OnBarUpdate() all your parameters are already set and whatever indicators were going to be added were already added as whatever they were set to before.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Plotting problems

                    Thanks for your suggestion. I commented out the if-then-else block in onBarUpdate() and it strategy still works as I wanted. However, I am still having a plotting problem. pane 0 looks fine immediately after back testing. If I touch the mouse to scroll back in time, then the plot rescales including zero, such that the plot is compressed at the top of the pane. What can I do to prevent this behavior?
                    Attached Files

                    Comment


                      #11
                      rocketman75,

                      Are any of your indicators or draw objects using values at 0 on that panel? If so, you would need to set AutoScale to false to not include it in the AutoScale region of the panel, otherwise it will resize to try to accomodate all objects into one visible y-range.
                      Josh P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      608 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      355 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      105 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      560 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      561 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X