Colored Zerolag MACD - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resource


This is the MQL5 version of ZeroLag MACD, available for MetaTrader 4: https://www.mql5.com/en/code/9993
There is also a colored version of it here, but it has some problems: https://www.mql5.com/en/code/8703
I fixed the MetaTrader 4 version, which has 95 lines of code. I spent 5 days writing the MetaTrader 5 version. (Read the logs and test multiple times to find out the differences between MetaTrader 5 and MetaTrader 4!)
My first MQL5 version of this indicator had 400 lines of code, but I optimized my code again and now in order to read all history it has about 290 lines of code!
In the first MQL5 version of this indicator, I used IMAonArray from the MetaTrader 5 site and the first load took 8 seconds to calculate 700 candles!
Since MetaTrader 5 does not have iMAonArray and the code iMAOnArrayMQL4 from https://www.mql5.com/en/articles/81 has some loops too much, so I rewrote it.
Also, time series in MetaTrader 5 goes from old candle to new candle (left to right), but in MetaTrader 4 the time array is set to time series by default, so it goes from new to old (right to left). Since the MQL4 version of the indicator is coded in a certain way, I could not simply set the array to a time series (change its direction) and get the correct results in MQL5, so I had to change all the loops and write my own method to calculate all historical candles for this MetaTrader 5 version.
Since the original code is free, I will also share the product for free on the market. Hopefully it will pick up signals faster than traditional MACD.


Attachment download
📎 far-macd-colored-zerolag.mq5 (14.37 KB)
Source: MQL5 #18250
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •