Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StrategyPlot starts plotting at zero in price panel

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

    StrategyPlot starts plotting at zero in price panel

    I have been using StrategyPlot for several indicators that plot in panels 2, 3 etc. and they work fine.

    I am now trying to overlay in the price panel and using

    if ( CurrentBar < 20 )
    return;

    which results in the indicator plotting at 0 on the 21st bar.

    In other panels this does not matter as they have a small scale and 0 center line. However in the price panel of course this compresses the price scale.

    I have tried everything I can think of to initialize the plot at the session start etc and nothing works. How do I start it at a realisitic value? Or even better stop it from plotting until the value > 0?

    I am using

    if ( !Historical && myPrice > 0 )
    myPlot(0).Value.Set( myPrice );

    and that makes no difference. It still plots on the 21st bar at 0.

    Thanks in advance.

    ATI

    #2
    How about only setting the plot value when it is greater than zero?
    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      How about only setting the plot value when it is greater than zero?
      you lost me there...am I not doing that with:

      if ( !Historical && myPrice > 0 )
      myPlot(0).Value.Set( myPrice );

      Comment


        #4
        See if you can turn off AutoScale. You may need to edit the StrategyPlot() indicator to do so if you cannot do it within the strategy.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          sorry Ray...I do not understand your reply...please see my last reply

          Comment


            #6
            ATI User this is Josh .

            What I suggested will not do anything for the plot setting itself to zero. If it worked in Panel 2 I have no idea why it behaves differently in Panel 1 aside from weird, complex code interactions. Putting that aside, perhaps setting AutoScale to false will just sidestep the issue. Go to the StrategyPlot() indicator and in the Initialize() method just add "AutoScale = false;". See if that does anything for you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              sorry Josh...I did not see that you had replied after Ray

              again, you have the instant fix....excellent....works fine...thanks....wish I had not wasted so much time chasing different solutions.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by charlesugo_1, 05-26-2026, 05:03 PM
              0 responses
              60 views
              0 likes
              Last Post charlesugo_1  
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              148 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              162 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 05-10-2026, 08:12 PM
              0 responses
              97 views
              0 likes
              Last Post CarlTrading  
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              284 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Working...
              X