HighestBar (Function)

image\trumpet2.gif Disclaimer

The HighestBar function returns the number of bars ago the highest price occurred.  There may be times when two or more bars have exactly the same highest value; when this happens the function identifies the most recent occurrence.

Syntax

HighestBar(Price, Length)

Returns (Integer)

The number of bars ago the highest Price occurred.

Parameters

Name

Type

Description

Price

Numeric

Specifies which bar value (price, function, or formula) to evaluate.

Length

Numeric

Sets the number of bars to consider.

Remarks

The input parameter Price can be a bar value such as Close, High, Low, Open, or Volume. It can also be any mathematical calculation such as: ( High + Low) / 2, or a numeric function such as RSI, Stochastic, or ADX.

Example

The following assigns the number of bars ago the highest value of the last 14 bars occurred to Value1:

Value1 = HighestBar(High, 14);

 

See Also

Highest, LowestBar, Extremes