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

简单的价格相对均线报警指标Alert_MA



Alert_MA指标可以设定价格在均线的某个距离内弹出报警窗口。

extern int range = 10;
extern int ma_period = 55;
if( (Bid <= ma+(range*Point)) && (Bid >= ma-(range*Point)))
Alert(Symbol()+” “+ma_period+” Moving Average range reached at “,Bid);
以上函数的意思就是当BID大于55均线下方10点小于55均线上方10点的时候提示报警。
如果你要加入其它组合报警方式,可以参考这里扩展。

Alert_MA指标图表效果:Alert_MA指标Alert_MA指标源码:

//+------------------------------------------------------------------+
//|                                                     Alert_MA.mq4 |
//|                                                          Kalenzo |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link      "http://www.125808047.com/"
extern int range = 10;
extern int ma_period = 55;
extern int ma_shift = 0;
extern int ma_method = MODE_EMA;
extern int applied_price = PRICE_CLOSE;
 
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment("www.125808047.com");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    
//----bb
   double ma = iMA(Symbol(),0,ma_period,ma_shift,ma_method,applied_price,0);
   
   if( (Bid <= ma+(range*Point)) && (Bid >= ma-(range*Point)))
   Alert(Symbol()+" "+ma_period+" Moving Average range reached at ",Bid);
    
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 简单的价格相对均线报警指标Alert_MA
上一篇:
下一篇:
分享到:更多 ()