• Overview
  • Reviews (3)
  • Comments (12)
  • What's new

MACD Colored ZeroLag

It is the MQL5 version of zero lag MACD that was available for MT4 here: https://www.mql5.com/en/code/9993

Also there was a colored version of it here but it had some problems: https://www.mql5.com/en/code/8703

I fixed the MT4 version which has 95 lines of code. It took me 5 days to write the MT5 version.(reading the logs and testing multiple times and finding out the difference of MT5 and MT4!)

My first MQL5 version of this indicator had 400 lines of code but I optimized my own code again and now for reading all of the history it has around 290 lines of code!

In My first MQL5 version of this indicator I used IMAonArray from MT5 site and it used to take 8 seconds to load for the first time for calculating 700 candles!

As MT5 does not have iMAonArray and the code iMAOnArrayMQL4 from https://www.mql5.com/en/articles/81 has some loops with too much cycles, so I rewrote it.

Also the time series in MT5 is from old to new candles ( from left to right ) but in MT4 the time array is set as timeseries by default, so it is from new to old ( right to left ). As the indicator was coded somehow that I couldn't simply set arrays as timeseries ( change their direction ) and get the correct results, so I had to change all the loops and write my own method to calculate all the candles of history.

As the original code was free, I will share product for free in market too. hope it will be useful for getting faster signals than the traditional MACD.


Indicator parameters

  • FastEMA - default is 12. the number for setting the faster EMA period.
  • SlowEMA - default is 26. the number for setting the slower EMA period. It's value should be greater than the FastEMA.
  • SignalEMA - default is 9. The number for setting the period for calculating the Signal line which is drawn in blue color.
Gennadiy Voltornist
12006
Gennadiy Voltornist 2017.11.29 19:03 
 

User didn't leave any comment to the rating

Daniel Andrejczuk
5390
Daniel Andrejczuk 2017.11.09 02:48 
 

User didn't leave any comment to the rating

Nork
6089
Nork 2017.01.31 07:00 
 

User didn't leave any comment to the rating

Version 805.311 2018.06.06
1. Fixed a small bug in one of the arrays. No other changes from version 805.251.
Version 805.251 2018.05.29
1. Added colored layers instead of histogram bars.
2. Added option for playing sound when it crosses zero axis (place your .wav file in "MetaTrader 5\Sounds" folder).