Mql5 coding question

 

Hi,

I have coded an indicator which usually swings between 0 and 100, but sometimes in a closer range. In the indicator window, tab "Scale" I can set a fixed minimum and a fixed maximum value by clicking the checkboxes and entering a value. By unchecking the checkboxes in that indicator window the axis will be scaled automatically.

Now, in my code I can set maximum and minimum by

void OnInit()
{
...

if (manual_scale)
{
    IndicatorSetDouble(INDICATOR_MINIMUM,5.0);
    IndicatorSetDouble(INDICATOR_MAXIMUM,95.0);
}

...
}

My question is, how can I deactivate those min and max settings? If manual_scale = false, there will still be no automatic scaling and the previous min and max values will still be used.

Any help would be appreciated