Zero Lag MACD

#1
_SECTION_BEGIN("Zero Lag MACD");
/*Xero Lag MACD(p,q,r)*/
//based on ZeroLag EMA - see Technical Analysis of Stocks and Commodities, April 2000
p = Param("P",12,3,36,2);
q = Param("Q",26,3,52,2);
r = Param("R",9,3,15,1);

EMA1= EMA(Close,p);
EMA2= EMA(EMA1,p);
Difference= EMA1 - EMA2;
ZeroLagEMAp= EMA1 + Difference;
//---------------------------------------
EMA1= EMA(Close,q);
EMA2= EMA(EMA1,q);
Difference= EMA1 - EMA2;
ZeroLagEMAq= EMA1 + Difference;
//---------------------------------------
ZeroLagMACD=ZeroLagEMAp - ZeroLagEMAq;
//---------------------------------------
// Signal line
EMA1= EMA(ZeroLagMACD,r);
EMA2= EMA(EMA1,r);
Difference= EMA1 - EMA2;
ZeroLagTRIG= EMA1 + Difference;

Plot(zerolagMACD,"",5,4);
Plot(zerolagtrig,"",colorCustom12,4);

HistInd = zerolagMACD - zerolagtrig;

scHistMax = LastValue(HHV(HistInd,
BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1) )));
scHistMin = LastValue(LLV(HistInd,
BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1) )));
scaleHist = Max( abs(scHistMax), abs(scHistMin) );

Plot(HistInd, _DEFAULT_NAME(),
IIf(HistInd>=0, ParamColor("Up Color", colorDarkGreen), ParamColor("Down Color", colorRed)),
ParamStyle( "Style", styleHistogram | styleThick, maskHistogram )
);

Plot( 0, "", colorBlue, styleLine);
//===========================end zeroLagMACD
_SECTION_END();

this is a good usefull indicator. just wanted it to bring to attention!
 
#4
Glad you liked it!

I understand you like to see buy/sell arrows, but it's in my opionion no use since you can't base a system or strategy on this indicator. It's merely a help-indicator, and a very good one.
This should be combined with others. Still I consider it, to add some basic scan/explore feature as to do.
 

Similar threads