跳至内容

iStochastic

iStochastic

计算随机振荡指数并返回其值。

double  iStochastic(
   string       symbol,           // symbol
   int          timeframe,        // timeframe
   int          Kperiod,          // K line period
   int          Dperiod,          // D line period
   int          slowing,          // slowing
   int          method,           // averaging method
   int          price_field,      // price (Low/High or Close/Close)
   int          mode,             // line index
   int          shift             // shift
   );

参数

symbol

[in] 将计算指标的数据中的符号名称。NULL表示当前符号。

timeframe

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

Kperiod

[in] %K线的周期。

Dperiod

[in] %D线的周期。

slowing

[in] 减速值。

method

[in] 移动平均方法。可以是ENUM_MA_METHOD枚举值中的任何一项。

price_field

[in] 价格字段参数。可以是以下值之一:0 - 低/高或1 - 收盘价/收盘价。

mode

[in] 指标线索引。可以是Indicators line identifiers枚举值中的任何一项(0 - MODE_MAIN,1 - MODE_SIGNAL)。

shift

[in] 从指标缓冲区获取的值的索引(相对于当前条形过去一定周期后的位移)。

返回值

随机振荡指数的数值。

示例:

if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0)) return(0);
最后更新于