I have developed an indicator which overrides OnCalculateMinMax() and it appears to be working correctly when it's first loaded, however if I zoom out and then zoom back in the indicator will still use the scale from a point of zoom where the min/max range was at its greatest.
Is there code that I can add that can force the update? not sure why it wouldn't already be doing this I thought OnCalculateMinMax() was supposed to be called when user drags, scrolls, etc...
below is the code from my override:
public override void OnCalculateMinMax()
{
// base.OnCalculateMinMax();
if (Bars == null || ChartControl == null)
return;
for (int idx = ChartBars.FromIndex; idx <= ChartBars.ToIndex; idx++)
{
double tmpHigh = iHigh.GetValueAt(idx);
double tmpLow = iLow.GetValueAt(idx);
if (tmpHigh != 0 && tmpHigh > MaxValue)
MaxValue = tmpHigh;
if (tmpLow != 0 && tmpLow < MinValue)
MinValue = tmpLow;
}
}

Comment