I've been developing an indicator for NinjaTrader 8 that uses 6 plots.
I wanted to disable autoscaling for the 5th and 6th plots.
Using the "OnCalculateMinMax()" works great for this, however I've noticed it will then only disable autoscaling for the 5th and 6th plots on the bars before the current bar.
Is there any way to ensure it disables autoscaling of those specific plots (5th and 6th plots) for the current bar as well?
Here is my code:
public override void OnCalculateMinMax()
{
double tmpMin = double.MaxValue;
double tmpMax = double.MinValue;
for (int index = ChartBars.FromIndex; index <= ChartBars.ToIndex; index++)
{
double plotValue1 = Values[0].GetValueAt(index);
double plotValue2 = Values[1].GetValueAt(index);
double plotValue3 = Values[2].GetValueAt(index);
double plotValue4 = Values[3].GetValueAt(index);
double plotValue5 = Values[4].GetValueAt(index);
tmpMin = Math.Min(tmpMin, Math.Min(Math.Min(plotValue1, plotValue2), Math.Min(plotValue3, Math.Min(plotValue4, plotValue5))));
tmpMax = Math.Max(tmpMax, Math.Max(Math.Max(plotValue1, plotValue2), Math.Max(plotValue3, Math.Max(plotValue4, plotValue5))));
}
MinValue = tmpMin;
MaxValue = tmpMax;
}
Any help will be much appreciated.

Comment