顺水外汇EA交易网MT4
标题:
麻烦版主!!!
[打印本页]
作者:
顺水的鱼
时间:
2011-8-4 15:48
标题:
麻烦版主!!!
麻烦版主把以下改为双线MACD,因为此指标是零滞后的,谢谢!
//+------------------------------------------------------------------+
//| ZeroLag MACD.mq4 |
//| RD |
//| marynarz15@wp.pl |
//+------------------------------------------------------------------+
#property copyright "RD"
#property link "marynarz15@wp.pl"
//----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int FastEMA = 12;
extern int SlowEMA = 24;
extern int SignalEMA = 9;
//---- buffers
double MACDBuffer[];
double SignalBuffer[];
double FastEMABuffer[];
double SlowEMABuffer[];
double SignalEMABuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init
{
//---- indicators
IndicatorBuffers;
SetIndexBuffer;
SetIndexBuffer;
SetIndexBuffer;
SetIndexBuffer;
SetIndexBuffer;
SetIndexStyle;
SetIndexStyle;
SetIndexDrawBegin;
SetIndexDrawBegin;
IndicatorShortName");
SetIndexLabel;
SetIndexLabel;
//----
return;
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit
{
//----
return;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start
{
int limit;
int counted_bars = IndicatorCounted;
if
return;
if
counted_bars--;
limit = Bars - counted_bars;
double EMA, ZeroLagEMAp, ZeroLagEMAq;
for
{
FastEMABuffer[i] = iMA;
SlowEMABuffer[i] = iMA;
}
for
{
EMA = iMAOnArray;
ZeroLagEMAp = FastEMABuffer[i] + FastEMABuffer[i] - EMA;
EMA = iMAOnArray;
ZeroLagEMAq = SlowEMABuffer[i] + SlowEMABuffer[i] - EMA;
MACDBuffer[i] = ZeroLagEMAp - ZeroLagEMAq;
}
for
SignalEMABuffer[i] = iMAOnArray;
for
{
EMA = iMAOnArray;
SignalBuffer[i] = SignalEMABuffer[i] + SignalEMABuffer[i] - EMA;
}
return;
}
//+------------------------------------------------------------------+
欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/)
Powered by Discuz! X3.2