Technical Analysis: A Gentle Introduction To The MACD Indicator

The MACD indicator is used to detect changes in the direction, momentum and duration of price trends.
The indicator is divided into three sub-indicators:
- The MACD itself
- The MACD signal
- The MACD divergence
The MACD itself
This indicator is simply the difference between the following two price series:
- A fast moving exponential moving average of the price (fast EMA)
- A slow moving exponential moving average of the price (slow EMA)
The MACD signal
This indicator is the exponential moving average (EMA) of the MACD itself.
The MACD Divergence
This indicator is the difference between the MACD itself and the MACD signal.
MACD parameters
The MACD takes 3 parameters:
- The time period of the fast EMA. This is usually set to 12.
- The time period of the slow EMA. This is usually set to 26.
- The time period of the signal EMA. This is usually set to 9.
The MACD is calculated from historical data (most often using the closing prices of candles).
Usage of the MACD
Price Trend Detection
Faster EMA’s respond faster to new price trends than slower EMA’s.
By comparing a fast EMA to a slow EMA, one is capable of detecting changes to the overall price trend.
More subtle changes to the price trend can be detected by analyzing the MACD divergence (the difference between the MACD itself, and the MACD average). Analysts may need to correlate the MACD divergence with another indicator, such as the Relative Strength Index (RSI).
MACD events
Signal line crossover
A signal crossover takes place when the MACD itself, and its exponentially moving average (the signal) cross each other.
A simple interpretation of the signal crossover is to go long when the MACD crosses up, through the signal (bullish crossover), and to go short when the MACD crosses below the signal (bearish crossover):
- MACD crosses above MACD signal: Go long
- MACD crosses below MACD signal: Go short
The abovementioned conditions can also be simplified to:
- MACD divergence goes from negative to positive: Go long
- MACD divergence goes from positive to negative: Go short
Zero crossover
A zero crossover takes place when the MACD changes sign (goes from negative to positive, or positive to negative).
When the zero crossover takes place, there is no difference between the fast EMA and the slow EMA.
- A zero crossover that goes from negative to positive is considered bullish.
- A zero crossover that goes from positive to negative is considered bearish.
Thus, one would do the following:
- MACD crossing above 0: Go long
- MACD crossing below 0: Go short
Divergence
A MACD divergence event takes place when the price reaches a new low or high, but the MACD, itself, does not.
- If the price reaches a new high, and the MACD does not, it’s called a Bearish divergence.
- If the price reaches a new low, and the MACD does not, it’s called a Bullish divergence.
Thus, one would do the following:
- If the price makes a new low, and the MACD does not: Go long
- If the price makes a new high, and the MACD does not: Go short
Duration
MACD’s with longer time periods are generally slower at detecting new price trends than MACD’s with shorter time periods.
However, there is a risk that shorter time period MACD’s only capture short-term price trends, and not longer term, intermediate price trends.
The duration can be varied either by changing the parameters, or by changing the time interval.
False positives
MACD signals may provide false positives — e.g. the price goes up, even though a bearish crossover just took place.
A way to combat this might be to require that the crossover is a strong crossover — e.g. that the difference between the MACD and the MACD signal is at least X.
One can do this on by creating a strategy like this:
Strong bearish crossover
Go short when:
- MACD goes below (MACD signal — 5)
By applying an offset (-5) to the MACD signal, the chance of the crossover reversing becomes significantly smaller.