MQL4参考 时间序列和指标访问 iLowest

iLowest

Returns the shift of the lowest value over a specific number of bars depending on type.

int  iLowest(
   string           symbol,          // symbol
   int              timeframe,       // timeframe
   int              type,            // timeseries id
   int              count,           // count
   int              start            // starting index
  );

Parameters

symbol

[in]  Symbol name. NULL means the current symbol.

timeframe

[in]  Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.

type

[in]  Series array identifier. It can be any of the Series array identifier 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 lowest value over a specific number of bars or -1 if error. To check errors, one has to call the GetLastError() function.

Example:

   double val;
//--- calculating the lowest value on the 10 consequtive bars in the range
//--- from the 10th to the 19th index inclusive on the current chart
   int val_index=iLowest(NULL,0,MODE_LOW,10,10);
   if(val_index!=-1) val=Low[val_index];
   else PrintFormat("Error in iLowest. Error code=%d",GetLastError());