Highest ( int length );
Default values:
length: 12
Description
Returns the highest value of data
for the last length
bars.
Input parameters
Parameter | Default value | Description |
---|---|---|
data | - | Defines data for which the highest value is found. |
length | 12 | Defines period on which the highest value is found. |
Example
input length = 20;
plot LowerBand = Lowest(low[1], length);
plot UpperBand = Highest(high[1], length);
plot MiddleBand = (LowerBand + UpperBand) / 2;
The plots in the example illustrate the Donchian Channels system where the Lower Band
and the Upper Band
are calculated as the minimum low and maximum high for the previous length
bars. Note that the low
and high
for the current bar are left out of account. In order to implement this approach the [1] index is applied to the corresponding parameters.