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 sjsj2732, 03-23-2026, 04:31 AM
              0 responses
              42 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              295 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              290 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              135 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              98 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X