|
|
威廉指标(%R)威廉指标(%R)用于确定市场是否超买/超卖。http://ta.mql4.com/indicators/oscillators/williams_percent 函数原型:double iWPR( string symbol, int timeframe, int period, int shift)
参数:交易品种 – 定义应该用于技术指标值计算的金融证券(货币对)。如果你需要当前(活动)的证券(图表),则使用 NULL(或 0)。时间范围 – 定义应该使用指标的时间范围(时长)。对当前时期使用 0 或以下常量之一(PERIOD_M1、PERIOD_M5、PERIOD_M15、PERIOD_M30、PERIOD_H1、PERIOD_H4、PERIOD_D1、PERIOD_W1、PERIOD_MN1)。period – 柱的数量,用于获取平均值。shift – 定义应该使用指标的柱。
使用示例:

double wpr; wpr=iWPR(0,0,14,1);
// overbought: the last but one bar on the active chart and period.// Use 14 bars to get the mean value.
wpr=iWPR("USDCHF",PERIOD_D1,9,0);
// overbought: The last bar on a daily chart USDCHF.// Use 9 bars to get the mean value.
wpr=iWPR("GBPJPY",PERIOD_H1,23,1);
// overbought: the last but one bar on an hour chart GBPJPY.// Use 23 bars to get the mean value.复制代码 |
|