Indicators: ZeroLag MACD

 

ZeroLag MACD:

The MACD oscillator with zero lag. This oscillator is MQL5 version of ZeroLag MACD indicator, published in Russian section of MQL4 CodeBase.

This indicator provides a signal few bars earlier, compared with standard MACD and its divirgence is much more clear.

ZeroLag MACD 

Author: Andrey Voytenko

 

You can create a multicolor version?

Thanks!

 
Automated-Trading:

ZeroLag MACD:

Author: Andrey Voytenko

I've been using your indicator for a few weeks now and I like it so much I would like to include it as confirmation in my EA.

However in the EA, the ExponentialMAOnBuffer() functions always fails, because begin is always zero:

   ExponentialMAOnBuffer(rates_total,prev_calculated,0,FastEMA,FastEMABuffer,val);

If you step the code through debug, you will see what I mean.

Why would this work in the indicator and not in an EA? 

Is there a fix for this?

TIA...ChuckM

 
ChuckM:

I've been using your indicator for a few weeks now and I like it so much I would like to include it as confirmation in my EA.

However in the EA, the ExponentialMAOnBuffer() functions always fails, because begin is always zero:

If you step the code through debug, you will see what I mean.

Why would this work in the indicator and not in an EA? 

Is there a fix for this?

TIA...ChuckM

Just to close the loop on this...if porting code from an indicator to an EA, the dynamic arrays need to be resized (ArrayResize())...in the indicator, this is done automatically.  Thanks for Rosh for showing me this...ChuckM
 
The previous version  ZeroLag_MACD  contained a bug, please download the latest version 3.0
 
avoitenko:
thank you for sharing .
Reason: