MACD, short for Moving Average Convergence Divergence, is a trend and momentum indicator built from the difference between two exponential moving averages of price. It has three parts: the MACD line, a signal line that smooths it, and a histogram showing the gap between the two. Created by Gerald Appel in the late 1970s, MACD is one of the most widely used indicators because it combines trend direction and momentum in a single panel. Like the moving averages it is built from, it lags price and describes moves that have already begun.
Key takeaways
- The MACD line is the 12-period EMA minus the 26-period EMA; the signal line is a 9-period EMA of the MACD line; the histogram is MACD minus signal.
- A MACD line above zero means the short-term average is above the long-term average, which is consistent with an uptrend.
- Signal-line crossovers are frequent and noisy; zero-line crossovers are slower and equivalent to a moving average crossover.
- The histogram shows whether the gap between MACD and its signal line is widening or narrowing, which traders read as momentum building or fading.
- MACD is measured in price units, so its values cannot be compared directly across assets with different prices.
On this page
How MACD is built
MACD uses three calculations, with default settings of 12, 26 and 9:
- MACD line = 12-period EMA of closing price - 26-period EMA of closing price.
- Signal line = 9-period EMA of the MACD line.
- Histogram = MACD line - signal line.
The name describes what the MACD line tracks: the two moving averages converging (moving closer together) and diverging (moving apart). When price rises steadily, the faster 12-period EMA pulls away above the slower 26-period EMA, and MACD grows more positive. When the rise slows, the averages converge and MACD shrinks toward zero.
The histogram was not part of the original design; it was added later by other analysts and is now standard on most platforms.
Reading the three components
| Component | What it shows | Common reading |
|---|---|---|
| MACD above zero | 12 EMA above 26 EMA | Short-term trend up relative to medium term |
| MACD below zero | 12 EMA below 26 EMA | Short-term trend down |
| MACD rising | Averages diverging upward or converging from below | Upward momentum increasing |
| MACD crosses above signal | Recent momentum turning up | Short-term bullish signal |
| MACD crosses below signal | Recent momentum turning down | Short-term bearish signal |
| Histogram growing | Gap between MACD and signal widening | Momentum accelerating |
| Histogram shrinking | Gap narrowing | Momentum slowing; a crossover may follow |
Worked example
On a given day, a stock's 12-day EMA is $105.40 and its 26-day EMA is $103.90. Yesterday's signal line was 1.20.
- MACD = 105.40 - 103.90 = 1.50
- The signal line's smoothing factor is k = 2 / (9 + 1) = 0.2.
- Signal = 1.20 + 0.2 x (1.50 - 1.20) = 1.20 + 0.06 = 1.26
- Histogram = 1.50 - 1.26 = 0.24
Next day, the rally slows and MACD eases to 1.40.
- Signal = 1.26 + 0.2 x (1.40 - 1.26) = 1.26 + 0.028 = 1.288
- Histogram = 1.40 - 1.288 = 0.112
The day after, MACD falls to 1.20.
- Signal = 1.288 + 0.2 x (1.20 - 1.288) = 1.288 - 0.0176 = 1.2704
- Histogram = 1.20 - 1.2704 = -0.0704
The histogram has turned negative: MACD has crossed below its signal line. Yet MACD itself is still well above zero, meaning the 12-day average remains above the 26-day average and the medium-term trend is still up. A trader would read this as momentum fading within an uptrend, not as a confirmed downtrend. The shrinking histogram on the second day gave an earlier warning than the crossover.
Why values are not comparable across assets
MACD is in price units. A MACD of 1.50 on a $104 stock is the same proportional gap as a MACD of 0.15 on a $10.40 stock. To compare assets, some traders use the Percentage Price Oscillator (PPO), which divides the EMA difference by the slower EMA. In the example, PPO = 1.50 / 103.90 x 100, about 1.44 percent. For the same reason, MACD readings from years ago on an asset whose price has changed a lot are not directly comparable with today's.
How traders use MACD
Signal-line crossovers
The most common use: buy when MACD crosses above the signal line, sell when it crosses below. These signals are frequent and react quickly, but in sideways markets they produce many whipsaws. Many traders only take crossovers in the direction of the larger trend, for example bullish crossovers only when MACD is above zero or price is above its 200-day average.
Zero-line crossovers
When MACD crosses zero, the 12 EMA is crossing the 26 EMA. This is exactly a moving average crossover, slower than a signal-line cross and with fewer false signals. Some traders use the zero line as a trend filter rather than a trigger.
Histogram momentum
The histogram changes direction before a crossover occurs. A peak in the histogram means the gap between MACD and its signal has stopped widening. Some traders use histogram turns as early exits or to tighten stops. Earlier signals come with more false alarms.
Divergences
As with RSI, a divergence is a disagreement between price and the indicator:
- Bearish divergence: price makes a higher high while MACD (or its histogram) makes a lower high.
- Bullish divergence: price makes a lower low while MACD makes a higher low.
Divergence shows momentum fading. It often appears before reversals but also appears repeatedly during trends that keep going. Because MACD is unbounded and depends on price level, divergences over long periods or across big price changes can be distorted. Most traders wait for price to confirm, for example with a break of structure.
Settings
The 12/26/9 default is a convention from the indicator's early use on daily charts. It is applied unchanged to every timeframe on most platforms.
| Setting | Effect |
|---|---|
| Shorter (for example 5/35/5 or 8/17/9) | Faster signals, more noise |
| Default 12/26/9 | Widely used; signals align with what other traders see |
| Longer (for example 19/39/9) | Smoother, fewer and later signals |
There is no evidence that any setting is universally better. Tuning the three parameters to fit past data is an easy way to overfit. See overfitting and data snooping.
The lag problem
MACD is built from moving averages, and its signal line is an average of a difference of averages. Each layer adds delay:
- A zero-line cross happens only after the 12 EMA has caught up with and passed the 26 EMA, by which time price has typically moved a good distance.
- A signal-line cross is faster but still follows the turn in price.
- In fast reversals, such as a sharp selloff after news, MACD can give a sell signal near the bottom of the move.
This lag is the price of smoothing. It makes MACD better suited to identifying and staying with sustained moves than to catching exact turning points. In choppy, sideways markets, lag plus frequent crossovers leads to repeated small losses.
What the evidence says
MACD rules have been tested in many markets with mixed results. Because MACD is essentially a moving average crossover system with extra smoothing, it inherits the same profile: it can capture sustained trends, which the trend-following research suggests have historically existed across many markets, while giving back gains in ranges. Standalone signal-line crossover systems on single assets have generally not shown consistent profits after costs. MACD is better viewed as a way to describe trend and momentum than as a source of edge on its own.
Common mistakes
- Trading every signal-line crossover. In ranges, most crossovers are noise.
- Comparing MACD values across assets or eras. Use percentage-based versions such as PPO if comparison matters.
- Counting MACD and RSI as two confirmations. Both come from the same closing prices.
- Expecting MACD to call tops and bottoms. It is designed to lag; it confirms turns after they start.
- Forgetting the zero line. A bearish crossover far above zero, in a strong uptrend, means something different from one below zero.
FAQ
What do the MACD settings 12, 26, 9 mean?
The MACD line is the 12-period EMA minus the 26-period EMA, and the signal line is a 9-period EMA of the MACD line. These defaults date from MACD's early use on daily charts and remain the standard on most platforms.
What is a MACD crossover?
A signal-line crossover is when the MACD line crosses its signal line: above is read as bullish, below as bearish. A zero-line crossover is when MACD crosses zero, which is the same as the 12 EMA crossing the 26 EMA.
What does the MACD histogram show?
The histogram shows the difference between the MACD line and its signal line. A growing histogram means momentum is accelerating in that direction, and a shrinking one means momentum is fading and a crossover may follow.
Is MACD a leading or lagging indicator?
MACD is a lagging indicator because it is built from moving averages of past prices. The histogram and divergences can give earlier hints, but these come with more false signals.