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

强力指数类指标 Heart Beat.mq4

Heart Beat指标是强力指数的一种优化。

图表:Heart Beat指标

源码:

//+------------------------------------------------------------------+
//|                                                   Heart Beat.mq4 |
//|                                                          tonyc2a |
//+------------------------------------------------------------------+
#property copyright "tonyc2a"
#property link      "http://www.125808047.com"
#property strict

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightBlue
#property indicator_maximum 0.07
#property indicator_minimum -0.07

double Buffer1[];
double forcey=0;
double upper=0.04;
double lower=-0.04;
double multiplicant=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
   SetIndexBuffer(0,Buffer1);
   SetIndexLabel(0,"EWO");
   Comment("www.125808047.com");
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration 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[])
  {
int    counted_bars=IndicatorCounted();
 if (Period()==30)
 {
 upper=0.2;
 lower=-0.2;
  }
 if (Period()==60)
 {
 upper=0.3;
 lower=-0.3;
 }
 if (Period()==5)
 {
 upper=0.0100;
 lower=-0.0100;
 multiplicant=5;
 }
 if (Period()==1)
 {
 upper=0.0005;
 lower=-0.0005;
 
 }
   for(int i=300 ;i>=1;i--)
   {
      forcey=iForce(NULL,0,7,0,PRICE_CLOSE,i)-iForce(NULL,0,7,0,PRICE_CLOSE,i+1);
      if (forcey > 0 && forcey < upper) forcey=0;
      if (forcey < 0 && forcey > lower) forcey=0;
      Buffer1[i]=forcey*multiplicant;
      }
   return(rates_total);
  }
//+------------------------------------------------------------------+
打赏
版权所有转载请注明标题及链接:峰汇在线 » 强力指数类指标 Heart Beat.mq4
上一篇:
下一篇:
分享到: 更多 (0)

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

支付宝扫一扫打赏

微信扫一扫打赏