帖子
作者
回复/查看
最后发表
//+------------------------------------------------------------------+
//| Custom MACD.mq4 |
//| Copyright ?2004, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+
//| Custom MACD.mq4 |
//| Copyright ?2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color2 Red
#property indicator_width1 1
//---- indicator parameters
extern int FastEMA=5;
extern int SlowEMA=15;
//---- indicator buffers
double MacdBuffer;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{IndicatorBuffers(1);
//---- drawing settings
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0,MacdBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MA5-ma10("+FastEMA+","+SlowEMA+",");
SetIndexLabel(0,"MACD");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i
2009-06-21 07:29
2009-06-21 02:47