Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Y Axis Fix

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

    Y Axis Fix

    Hi Everyone
    Is it possible, in the indicator panels, (not panel 1 of course), to set the Y axis to have a constant range e.g. -100 to +100. Sometimes automatic Y axis scaling masks what is realy going on. If an indicator sometimes swings between -100 and +100, but at other times only between -1 and +1 (say), automatic scale changes can lead to a similar appearance when the meaning is quite different.
    If its possible to set a fixed range could you tell me how to do it please?

    Thanks
    Dave

    #2
    Hello,

    To fix the range add two plot lines and fix their values like this:

    Add(new Plot(Color.Black, PlotStyle.Line, "Zero Line"));
    Add(new Plot(Color.Black, PlotStyle.Line, "100 Line"));

    Values[1].Set(0);
    Values[2].Set(100);

    The above fixes the indicator panel range 0 to 100.
    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks Ben, just what I wanted.
      Its a pity that I had to ask though, I'll bet there is a VERY large amount of useful stuff like this that, like Values.Set, is not in the user documentation.

      Comment


        #4
        Values[] is in the documentation. It is just another way to access your plots without calling its particular name. The .Set is just like how you would set any other plot value.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I see how its meant to work now, however, I spoke too soon, it doesn't work for me.
          I now have -

          protected override void Initialize()
          {
          Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "PlotSlope"));
          Add(new Line(Color.FromKnownColor(KnownColor.DarkOliveGree n), 0, "Zero"));
          Add(new Plot(Color.Black, PlotStyle.Line, "Plus20"));
          Add(new Plot(Color.Black, PlotStyle.Line, "Minus20"));
          Values[1].Set(20);
          Values[2].Set(-20);

          CalculateOnBarClose = false;
          Overlay = false;
          PriceTypeSupported = false;
          POsc = new DataSeries(this);
          }


          The code compiles OK, but does not draw any of the plots. The Y scale is fixed at 0 to 1.

          Comment


            #6
            You cannot set it in the Initialize() method. You need to set it in the OnBarUpdate(). It is just like any other plot. No different.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Doh!

              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              578 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 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
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X