有您的持续关注
我们会做得更好

趋势指标Waddah_Attar_Trend



Waddah_Attar_Trend指标用颜色给出了买卖参考信号,实际操盘中可以结合其它方法来有效的寻找开仓点并跟踪止损和盈利。

Waddah_Attar_Trend指标图表效果如下:Waddah_Attar_Trend指标

Waddah_Attar_Trend指标源码如下:

//+------------------------------------------------------------------+
//|                                           Waddah_Attar_Trend.mq4 |
//|                                     Copyright 2016, QQ:125808047 |
//+------------------------------------------------------------------+
#property copyright "www.125808047.com"
#property link      "http://www.125808047.com/"
//----
#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Green
#property  indicator_color2  Red
//----
double   ind_buffer1[];
double   ind_buffer2[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
//----   
   SetIndexBuffer(0, ind_buffer1);
   SetIndexBuffer(1, ind_buffer2);
//----   
   IndicatorShortName("Waddah Attar Trend");
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double Trend,Explo,val;
   int    limit, i, counted_bars = IndicatorCounted();
//----
   if(counted_bars < 0) 
       return(-1);
//----
   if(counted_bars > 0) 
       counted_bars--;
   limit = Bars - counted_bars;
//----
   for(i = limit - 1; i >= 0; i--)
     {
       Trend = (iMACD(NULL, 0, 20, 40, 9, PRICE_CLOSE, MODE_MAIN, i) - 
                iMACD(NULL, 0, 20, 40, 9, PRICE_CLOSE, MODE_MAIN, i + 1)) / Point;
       Explo = (iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_UPPER, i) - 
                iBands(NULL, 0, 20, 2, 0, PRICE_CLOSE, MODE_LOWER, i)) / Point;
       ind_buffer1[i] = 0;
       ind_buffer2[i] = 0;
       val=Trend*Explo;
       if(val >= 0)
           ind_buffer1[i] = val;
       if(val < 0)
           ind_buffer2[i] = val;
     }
   return(0);
  }
//+------------------------------------------------------------------+

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 趋势指标Waddah_Attar_Trend
上一篇:
下一篇:
分享到:更多 ()