Define Scale of Indicator Outputs

IMinMax interface defines the getMinMax method.This method is called once for every output. Method must return array of doubles with two elements: minimal value and maximal value. These values will be used to define the scale for the indicator if it's drawn on a separate panel under the main chart. If one of the values is Double.NaN it will be ignored. getMinMax is not a mandatory method because system gets minimal and maximal values from the calculated values automatically but in cases when indicator's output is of type Object it's necessary to define this method to provide the correct values.

Method "getMinMax" accepts the following arguments:

  • outputIdx - index of the output.
  • values - calculated values.
  • firstVisibleValueIndex - index of the first value that corresponds to the candle that is visible on the screen. Will be equal to 0 even if the length of a value array is 0.
  • lastVisibleValueIndex - index of the last value that corresponds to the candle that is visible on the screen. Will be equal to -1 if the length of a value array is 0.
The information on this web site is provided only as general information, which may be incomplete or outdated. Click here for full disclaimer.