Library · Indicators
MACD
MACD (Moving Average Convergence Divergence) plots the gap between a fast and a slow exponential moving average, showing whether that gap is growing or shrinking.
MACD
0:51 · captioned1/4What it is
2/4How it is built
3/4Reading it
- Above 0: fast average above slow average
- Line crosses signal = momentum shifted
4/4Its limits
- Context, not a signal
How the MACD line, signal line and histogram are built from moving averages, and why they always lag.
Transcript
- What it is
- MACD stands for Moving Average Convergence Divergence.
- It shows how two moving averages of price relate to each other.
- How it is built
- The MACD line is the 12-period exponential average minus the 26-period one.
- The signal line is a 9-period average of the MACD line.
- The histogram is simply the gap between those two lines.
- Reading it
- Above zero, the faster average is above the slower one. Below zero, it is underneath.
- When the MACD line crosses its signal line, momentum has shifted.
- Its limits
- But every value is built from past prices, so MACD always lags.
- In a sideways market, the lines cross again and again without a lasting move.
- MACD describes trend and momentum. It is context, not a signal.
Educational explainer with hypothetical data. Not financial advice.
Why it matters
Two moving averages on a chart show direction. What is harder to see by eye is whether they are pulling apart or drifting back together. MACD, short for Moving Average Convergence Divergence, measures exactly that distance and plots it in its own panel.
It was developed by Gerald Appel and is one of the most common indicators on any platform. Its three moving parts confuse many beginners, so it is worth taking them one at a time.
What it looks like
- MACD line: the gap between a fast and a slow EMA.
- Signal line: a smoothed copy of the MACD line. Despite its name, it is only an average.
- Histogram: bars showing how far the MACD line is from the signal line.
How it is calculated
- Two EMAsA 12-period and a 26-period EMA of the close.
- MACD lineEMA 12 minus EMA 26.
- Signal lineA 9-period EMA of the MACD line.
- HistogramMACD line minus signal line.
MACD line = EMA(12) - EMA(26)Both EMAs are calculated on closing prices.Signal line = EMA(9) of the MACD line Histogram = MACD line - signal lineThe standard settings are written as 12, 26, 9.“Convergence” means the two EMAs are moving closer together, so MACD shrinks toward zero. “Divergence” here means they are moving apart, so MACD grows away from zero.
In plain words
Picture two runners on a track, one quick and one steady. MACD is the distance between them. When the quick runner pulls ahead, the gap grows. When the quick runner tires, the gap shrinks, even though both are still running forward. The histogram shows whether the gap is opening or closing.
One candle of MACDHypothetical illustration
On a hypothetical chart the 12-period EMA is 104.0 and the 26-period EMA is 101.0.
MACD line = 104.0 - 101.0 = 3.0. The signal line currently reads 2.2, so the histogram is 3.0 - 2.2 = 0.8.
On the next candle the EMAs are 104.5 and 101.6. MACD = 2.9. The signal line updates with a multiplier of 2 / (9 + 1) = 0.2: (2.9 x 0.2) + (2.2 x 0.8) = 0.58 + 1.76 = 2.34. The histogram is 2.9 - 2.34 = 0.56.
Both EMAs rose and MACD is still well above zero. But the gap stopped widening, so the histogram shrank from 0.8 to 0.56.
How to read it
- MACD above zero> 0The 12-period EMA is above the 26-period EMA. Recent closes average higher than older ones.
- MACD at zero0The two EMAs are equal. On the price chart they are crossing.
- MACD below zero< 0The 12-period EMA is below the 26-period EMA. Recent closes average lower than older ones.
| What you see | What it describes |
|---|---|
| MACD crosses above zero | The 12-period EMA has crossed above the 26-period EMA |
| MACD crosses below zero | The 12-period EMA has crossed below the 26-period EMA |
| MACD crosses above the signal line | MACD is now higher than its own recent average, so the histogram turns positive |
| MACD crosses below the signal line | MACD is now lower than its own recent average, so the histogram turns negative |
| Histogram bars growing | The gap between MACD and signal is widening |
| Histogram bars shrinking | The gap is narrowing. The current push is losing pace |
Every row describes what the averages have already done. A zero-line cross is the same event as a moving average crossover on the price chart, shown in a different place. None of these events is a signal.
Settings and what they change
The defaults are 12, 26, 9. Shorter periods make all three parts react faster and cross more often. Longer periods make them smoother and later.
Because MACD is an average of averages, it carries the lag of each layer. The signal line is slower than the MACD line, which is slower than price. Adjusting the three numbers until past charts look ideal is overfitting: three settings give many combinations, and some of them are likely to fit old data by chance.
Going deeper
MACD is not bounded
RSI runs from 0 to 100, so a reading of 80 means the same on any chart. MACD is measured in price units. A MACD of 3 is large for an asset priced at 100 and negligible for one priced at 50,000. This means there are no universal “high” or “low” MACD levels, and values cannot be compared between assets.
Divergence
When price makes a higher high while MACD or its histogram makes a lower high, traders call it a divergence. It is commonly interpreted as the latest push having less momentum than the previous one. It can be followed by a reversal, a pause or a continuation.
How practitioners use it
MACD sits between the trend and momentum families. Many traders use the zero line as a slow read on trend and the histogram as a faster read on momentum, always alongside market structure and volume. In a range, MACD hovers near zero and crosses its signal line repeatedly, which says little.
What it does NOT mean
- The signal line does not give signals. It is a 9-period EMA of the MACD line. The name is historical.
- A signal-line cross is not a “buy signal” or “sell signal”. It shows that MACD has moved past its own average, which happens constantly in sideways markets.
- A shrinking histogram does not mean price is falling. It means the gap between two lines is narrowing. Price can still be rising.
- A high MACD value does not mean “overbought”. MACD has no fixed scale and no built-in extremes.
Common mistakes
- Reacting to every signal-line cross. Near the zero line in a quiet market these crosses are mostly noise.
- Reading the histogram as price direction. It measures a change in momentum, two steps removed from price.
- Comparing MACD values across assets or timeframes. The scale depends on price.
- Pairing MACD with moving average crossovers as “confirmation”. Both are built from the same averages, so their agreement is expected.
Risks and limitations
- MACD lags. It is built from EMAs, and the signal line adds a further layer of smoothing.
- It produces frequent false crosses in ranging or choppy markets.
- It uses closing prices only and ignores volume, volatility and liquidity.
- Its unbounded scale makes extreme readings hard to judge without context.
Key takeaway
MACD is the gap between a 12-period and a 26-period EMA, with a 9-period average of that gap and a histogram of the difference. It describes how trend and momentum have been changing, after the fact.
Sources and further reading
- Technical Analysis: Power Tools for Active Investors, Gerald Appel (2005). MACD explained by the analyst who developed it
- Technical Analysis of the Financial Markets, John J. Murphy (1999)