诚信为本
量力而为
当前位置:峰汇在线 > MetaTrader 4 > MT4指标 > 正文

CandleBodyPrcnt.mq4

CandleBodyPrcnt指标注释特定的价差指数。

图表:CandleBodyPrcnt指标

源码:

//+------------------------------------------------------------------+
//|                                              CandleBodyPrcnt.mq4 |
//|                  Copyright @2008, Ronald Verwer / Forex MetaSoft |
//+------------------------------------------------------------------+
#property copyright "Copyright @2008, Ronald Verwer / Forex MetaSoft"
#property link      "http://www.125808047.com"

#property indicator_chart_window

int i;
double prcnt,OverAllPercent;
//+------------------------------------------------------------------+
//| script initialization function                                   |
//+------------------------------------------------------------------+
int OnInit(void)
{
  Comment("www.125808047.com");
  return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| script execution function                                        |
//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   for(i=Bars;i>=0;i--)
      {
      if(High[i]-Low[i]>0)
         prcnt+=((MathAbs(Open[i]-Close[i]))/(High[i]-Low[i]))*100;
      }
   OverAllPercent=prcnt/(Bars+1);

   Comment("\nAverage Candle Body of the "+Symbol()+" currency pair is "+DoubleToStr(OverAllPercent,2)+"%");
   return(rates_total);
   }
//+------------------------------------------------------------------+
打赏
版权所有转载请注明标题及链接:峰汇在线 » CandleBodyPrcnt.mq4
上一篇:
下一篇:
分享到: 更多 (0)

如您觉得此文不错请扫码打赏!

支付宝扫一扫打赏

微信扫一扫打赏