GetMinValueOffset

GetMinValueOffset ( int length );

Default values:

length: 25

Description

Returns the offset of the lowest value of data for the last length bars.

Input parameters

Parameter Default value Description
data - Defines data for which the lowest value is found.
length 25 Defines period on which the lowest value is found.

Example

declare lower;

input length = 25;

def upIndex = GetMaxValueOffset(high, length);
def downIndex = GetMinValueOffset(low, length);

plot AroonOsc = (downIndex - upIndex) * 100.0 / length;

The example calculates the Aroon Oscillator. The GetMinValueOffset is used to calculate the downIndex variable that defines the number of bars appeared starting from the minimum value for the last length bars. Then the downIndex value and the upIndex values are used to draw the resulting AroonOsc plot.