Forum on trading, automated trading systems and testing trading strategies
Indicators: MACD Histogram, multi-color
newdigital, 2014.06.19 12:01
Moving Average Convergence Divergence (MACD)MACD stands for Moving Average Convergence Divergence and was first developed by Gerald Appel in the late 1970s. It is an Absolute Price Oscillator (APO) and can be used in an attempt to identify changes in market direction, strength and momentum.
It calculates the convergence and divergence between a ‘fast’ and a ‘slow’ Exponential Moving Average (EMA) known as the MACD Line. A signal EMA is then plotted over the MACD Line to show buy/sell opportunities. Appel specified the MA lengths as the following percentages:
- Slow EMA = 7.5% (25.67 period EMA)
- Fast EMA = 15% (12.33 period EMA)
- Signal EMA = 20% (9 period EMA)
One of the biggest challenges when dealing with financial data is noise or erratic movements that cause false signals. By smoothing data out you can reduce the number of false signals. But this comes at a cost, and causes an increase in the lag of your signals. The genius of the MACD is that it begins by smoothing data (thus causing lag) and then speeds up the signals from the smoothed data. This combination helps to reduce false signals while minimising the lag.
By comparing EMAs of different lengths the MACD can help to identify subtle changes in the trend and momentum of a security. It is a great visual representation of the acceleration or rate of change in a trend.
How to Calculate a MACD
MACD Formula:
- MACD Line = EMA,12 – EMA,26
- Signal Line = EMA[MACD,9]
- MACD Histogram = MACD – Signal Line
- Histogram Trigger = EMA[MACD Histo,5]
MACD Excel File
We have put together an Excel Spreadsheet that will automatically adjust to the MACD settings you desire. Find it at the following link near the bottom of the page under Downloads – Technical Indicators: Moving Average Convergence Divergence (MACD)
Test Results
Is the MACD an effective indicator? We are putting it into the ring for the Technical Indicator Fight for Supremacy. It will be tested through 300 years of data across 16 global markets to discover which settings produce the best results and how it performs compared to other indicators:
- Moving Average Crossovers – Completed - Golden Cross – Which is the best?
- Moving Average Convergence Divergence (MACD) – Completed – Results
- ZeroLag MACD (ZL-MACD)
- MACD Z Score (MAC-Z)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
MACD Sample:
The MACD Sample EA is included in the standard pack of the MetaTrader 5 client terminal and is an example of the EA that trades using the MACD indicator.
The file of the MACD Sample.mq5 Expert Advisor is located in terminal_data_folder\MQL5\Experts\Examples\MACD\". This Expert Advisor is an example of object-oriented approach in EA development.
Author: MetaQuotes Software Corp.