The Moving Average Convergence Divergence (MACD), developed by Gerald Appel in the late 1970s, measures the difference between two exponential moving averages of price. When the faster average pulls away from the slower one, momentum is building; when they converge, it is fading.
MACD has three parts: the MACD line, a signal line (an EMA of the MACD line) and a histogram showing the gap between the two. It combines trend and momentum in one panel, which is why it is one of the most popular indicators.
- Price (sample data)
- EMA 12
- EMA 26
- Histogram
- MACD line
- Signal line
Calculated on an illustrative price series, not real market data. The MACD line is the gap between the 12- and 26-period EMAs shown on the price chart.
How it is calculated
MACD line = EMA12 − EMA26 Signal = EMA9(MACD line) Histogram = MACD line − Signal
- EMA12, EMA26
- 12- and 26-period exponential moving averages of the closing price
- EMA9
- 9-period exponential moving average of the MACD line
How traders read it
- Signal-line crossovers: the MACD line crossing above its signal line is read as bullish momentum; crossing below as bearish.
- Zero-line crossovers: MACD above zero means the 12-period EMA is above the 26-period EMA, a sign of an uptrend; below zero, a downtrend.
- Histogram: shrinking bars show momentum slowing, often before a crossover happens.
- Divergence: price making a new high while MACD makes a lower high suggests weakening momentum.
Common settings
- 12, 26, 9 is the standard and by far the most used setting.
- Faster settings (such as 5, 35, 5) react sooner but whipsaw more; some longer-term investors apply MACD to weekly charts instead of changing the numbers.
- MACD values are in price units, so they cannot be compared directly across assets with different prices.
Limitations
Because it is built from moving averages, MACD lags. Crossovers come after the move has started, and in sideways markets the lines cross repeatedly and give many false signals.
Divergences can last a long time before price reacts, and sometimes price never does. Like other indicators, MACD rules should be backtested before being relied on.
Works well with
An oscillator such as RSI to judge whether a move is stretched, and volume to check whether a move has participation. See the momentum confirmation combination.
Worked example
Worked example
Suppose the 12-day EMA of a share is 52.40 and the 26-day EMA is 51.10. The MACD line is 52.40 − 51.10 = 1.30: the short-term average is above the long-term one, a sign of upward momentum.
If the 9-day EMA of the MACD line (the signal line) is 1.05, the histogram is 1.30 − 1.05 = 0.25. A positive and growing histogram means momentum is building; a positive but shrinking histogram means the rise is slowing even though the trend may still be up.
Because MACD is measured in price units, a reading of 1.30 means something different for a share at 50 than for one at 500. Compare MACD with its own history, not across different assets.
Common mistakes
- Acting on every crossover of the signal line. In choppy markets they flip back and forth many times.
- Treating divergence as a timing signal. Momentum can stay weaker than price for a long time before anything happens.
- Comparing MACD values between assets with very different prices.
Frequently asked questions
What do the MACD numbers 12, 26, 9 mean?
They are the periods of the fast EMA (12), the slow EMA (26) and the signal-line EMA (9). They are the standard settings and the defaults on most charting platforms.
Is MACD a trend or momentum indicator?
Both. Its position above or below zero shows the trend, while the speed of change and the histogram show momentum.
What is the MACD histogram?
The difference between the MACD line and its signal line, drawn as bars. It shows whether the gap between the short and long averages is widening or narrowing, so it often turns before the lines themselves cross.
Related
More trend indicators
Indicators describe what prices have done; none of them predicts what prices will do. Charts use an illustrative price series, not real market data. This page is education, not investment advice.