Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddPlot autoscaling. Ninja support, please advise

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

    AddPlot autoscaling. Ninja support, please advise

    Hi,

    I have a quick question. I have an indicator where I plot 3 data: High, Close, Low.
    Now, my issue is that the chartscale of the indicator autoscales to all three plots.
    Meaning I will see all of the plots in the indicator window, whereas I only want to see the latest data within the visible area of the chart.
    Here are some screenshots:

    This is the annoying one, which I am unable to change. You can see the plot with the yellow line what I want to see. I do not need the green.
    The yellow plot is too small here, because the green one has increased the right scale.

    Click image for larger version  Name:	AnnoyingHighPlot.png Views:	0 Size:	43.6 KB ID:	1114949

    Now, when I set the color of the high plot (green) to Transparent. It works, and it only shows the red and the yellow. (duh) It scales just fine.

    Click image for larger version  Name:	VisibleRangeOnly1.png Views:	0 Size:	142.9 KB ID:	1114951

    There is a dirty workaround, like this:
    Code:
    if (Values[0][0] > 0) {
    Values[1][0] = currentHigh;
    } else {
    Values[2][0] = currentLow;
    }
    Using this code, it looks like this and I can scale it well, but obviously I am missing some plot data this way:

    Click image for larger version  Name:	Workaround1.png Views:	0 Size:	304.0 KB ID:	1114952
    ​​

    Switching colors to transparent and reloading the indicator is a pain in the neck.
    So basically I wish to disable autoscale for the individual plots.
    Is there something what i can use to solve this?



    Indicator settings nothing interesting here:

    Click image for larger version  Name:	IndicatorSettings1.png Views:	0 Size:	25.6 KB ID:	1114950

    Thanks in advance!

    #2
    Hello Gorkhaan, thanks for your post.

    We have the OnCalculateMinMax method for this purpose:
    https://ninjatrader.com/support/help...lateminmax.htm

    That gives you control over where the y axis is scaled around when IsAutoScale is enabled in the script.

    Please let me know if you have any questions on this material.

    Comment


      #3
      That was it. Thanks Chris for pointing me to the right direction.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X