ihighest()
Previous  Next

Returns the shift of the maximum value over a specific number of bars depending on type.
int ihighest(int timeframe, // timeframe
int type, // timeseries
int count, // count
int start=0 // start
);


Parameters
timeframe
[in] Timeframe. It can be any of PERIOD_ enumeration values.
type
[in] Series array identifier. It can be any of the MODE_ enumeration values.
count=WHOLE_ARRAY
[in] Number of bars (in direction from the start bar to the back one) on which the search is carried out.
start=0
[in] Shift showing the bar, relative to the current bar, that the data should be taken from.
Returned value
The shift of the maximum value over a specific number of bars or -1 if error.
Example:
double val;
//--- calculating the highest value on the 20 consecutive bars in the range
//--- from the 4th to the 23rd index inclusive on the current chart
int val_index=[ihighest(1440,MODE_HIGH,20,4)];
if(val_index!=-1) val=lowa[val_index];
else Printf("Error in call ihighest.");