MT4指标源码之双线MACD公式
-
相关简介:MT4指标源码之双线MACD公式 mt4本身提供了一个macd指标,不过这个技术指标画出来同我们国内朋友们习惯的双线macd不太一样。 技术指标源码如下: ================================================================================================== //+------------------------------------------------------------------+ //
-
文章来源:股海网作者:股海网发布时间:2014-07-17浏览次数:
MT4指标源码之双线MACD公式
mt4本身提供了一个macd指标,不过这个技术指标画出来同我们国内朋友们习惯的双线macd不太一样。
技术指标源码如下:
==================================================================================================
//+------------------------------------------------------------------+
//| Custom MACD.mq4 |
//| Copyright ?0213, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "deville"
#property link "deville"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Silver
#property indicator_color2 White
#property indicator_color3 Red
#property indicator_color4 Green
#property indicator_color5 Purple
#property indicator_width1 1
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
static double MacdBuffer[];
static double FastEMAbuffer[];
static double SlowEMAbuffer[];
static double MacdBufferUp[];
static double MacdBufferDown[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
//---- drawing settings
//---- indicator buffers mapping
//---- name for DataWindow and indicator subwindow label
//---- initialization done
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
//---- last counted bar will be recounted
//---- macd counted in the 1-st buffer
//---- signal line counted in the 2-nd buffer
//---- signal line counted in the 2-nd buffer
//---- done
//+------------------------------------------------------------------+
如下图:
上一篇:冰山客的最新蝴蝶指标
下一篇:mt4的supertrend公式