跳至内容

iHighest

iHighest

返回特定数量条形图上最大值的偏移量,具体取决于类型。

int  iHighest(
   string           symbol,          // symbol
   int              timeframe,       // timeframe
   int              type,            // timeseries
   int              count,           // cont
   int              start            // start
  );

参数

symbol

[in] 用于搜索的数据符号。NULL表示当前符号。

timeframe

[in] 时间框架。可以是ENUM_TIMEFRAMES枚举值中的任何一种。0表示当前图表时间框架。

type

[in] 序列数组标识符。可以是Series array identifier枚举值中的任何一种。

count=WHOLE_ARRAY

[in] 进行搜索的条形数(从起始条形到最后一条形)。

start=0

[in] 相对于当前条形显示的要从中获取数据的条形偏移量。

返回值

特定数量条形图上最大值的偏移量,或发生错误时返回-1。要检查错误,需要调用GetLastError()函数。

示例:

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(NULL,0,MODE_HIGH,20,4);
   if(val_index!=-1) val=High[val_index];
   else PrintFormat("Error in call iHighest. Error code=%d",GetLastError());
最后更新于