Links

GetSeriesHighestValue

Description

The GetSeriesHighestValue() method searches within a predetermined number of periods for the highest bar and outputs how many bars ago it can be found.

Parameter

period Number of bars within which the bar is searched for
series Every data series, such as close, high, low, etc.

Return Value

int barsAgo How many bars ago the high occurred

Usage

GetSeriesHighestValue(IDataSeries series, int period)

Example

// How many bars ago was the highest high for the current session?
Print(GetSeriesHighestValue(High, Bars.BarsCountForSession - 1));
// What value did the market price have at the highest high of the session?
Print("The highest price for the session was: " + Open[GetSeriesHighestValue(High, Bars.BarsCountForSession - 1)]);