Moving Average Convergence Divergence
The relationship between two exponential moving averages. The histogram visualizes the gap between them - widening = momentum building, narrowing = momentum fading.
Moving Average Convergence Divergence on AMZN, daily candles. Data via Financial Modeling Prep, cached server-side.
Quick reference
The Moving Average Convergence Divergence indicator is the second-most-cited momentum tool in retail trading after RSI, and the first place most beginners discover that "momentum" can be measured at all. Gerald Appel published MACD in the late 1970s; the 12-26-9 default settings have not changed in 45 years and are still the canonical version on every trading platform.
MACD is more useful than its reputation suggests, but only when read correctly. Most traders learn one signal (the MACD line crossing the signal line) and ignore the more reliable ones (the zero-line cross, divergence, and histogram momentum). This page covers all of them, the calculation behind each, and the specific market conditions where MACD breaks down.
What MACD actually measures
MACD answers a single question: how much is the 12-period EMA pulling away from, or moving toward, the 26-period EMA?
When prices accelerate, the fast EMA (12) outruns the slow EMA (26) and the MACD line rises. When prices stall or reverse, the fast EMA converges back toward the slow EMA and the MACD line falls. The signal line (a 9-period EMA of the MACD line) smooths that movement into a slower curve that the MACD line crosses through.
The histogram - the bars below the chart - is the most underrated component. It plots the difference between the MACD line and the signal line. When the histogram is positive and growing, momentum is accelerating to the upside. When it is negative and growing more negative, momentum is accelerating downward. A histogram peaking and starting to shrink is your earliest sign that momentum is fading, often before the MACD and signal lines visibly cross.
The formula
MACD line = 12-EMA(close) - 26-EMA(close)
Signal line = 9-EMA(MACD line)
Histogram = MACD line - Signal line
EMA stands for exponential moving average. Each new value is computed as:
EMA(new) = (Close × k) + (EMA(prior) × (1 - k))
where k = 2 / (N + 1)
For the 12-EMA, k ≈ 0.154. For the 26-EMA, k ≈ 0.074. For the 9-EMA signal line, k = 0.2.
The exact values do not matter to most traders. What matters is that the fast EMA reacts faster to price changes than the slow EMA, and the MACD line captures that difference.
A worked example
Suppose the 26-EMA on an instrument is 100.00 and the 12-EMA is 102.40. The MACD line reads:
MACD = 102.40 - 100.00 = 2.40
A new bar prints at 105.00. Both EMAs update:
12-EMA(new) = (105.00 × 0.154) + (102.40 × 0.846) ≈ 102.80
26-EMA(new) = (105.00 × 0.074) + (100.00 × 0.926) ≈ 100.37
MACD(new) = 102.80 - 100.37 = 2.43
The MACD line ticked up from 2.40 to 2.43, which makes sense: the fast EMA pulled away from the slow EMA faster than the slow EMA caught up.
Now imagine the signal line was tracking at 2.20. After this new bar, the histogram = 2.43 - 2.20 = 0.23 (positive and slightly larger than the prior bar). The histogram is telling you momentum is building.
If the next several bars print downward and the fast EMA starts falling back toward the slow EMA, the MACD line drops, the signal line catches up, and eventually the MACD line crosses below the signal - the classic bearish crossover.
How traders actually use MACD
Three signals are worth knowing. Beyond these, most "MACD trading systems" do not survive contact with real markets.
1. Zero-line cross (the cleanest signal)
When the MACD line crosses above zero, the 12-EMA has crossed above the 26-EMA. That is a textbook trend-regime change. Crossing below zero is the inverse.
Why this is the strongest MACD signal: it requires two EMAs to have actually crossed, not just to be moving toward each other. A signal-line cross can happen with both EMAs still pointed in the same direction.
The trade-off is lag. By the time the zero-line crosses, the new trend has often moved 5 to 10 percent. MACD is a confirmation indicator, not an entry trigger.
2. Divergence
Like RSI, MACD divergence is its highest-conviction setup.
- Bullish divergence: price prints a lower low; MACD prints a higher low. The new low lacks downside momentum.
- Bearish divergence: price prints a higher high; MACD prints a lower high. The rally has weak hands.
MACD divergence is more reliable on the daily chart than on intraday timeframes. Intraday MACD divergences are common and resolve in both directions roughly equally - they are not a tradeable edge without additional confluence.
3. Histogram momentum shift
The histogram peaks and starts to shrink while the MACD line is still rising. This is your earliest indication that momentum is fading - often 5 to 10 bars before the MACD and signal lines cross.
For active traders, the histogram pattern is the most useful MACD read because it surfaces momentum changes ahead of the lagging line crosses. It is also the noisiest, so pair it with structure (a break of a recent swing high or low) before acting.
The trap most retail traders fall into
The standard MACD lesson treats every signal-line cross as a buy or sell trigger. On any reasonably trending market, this strategy bleeds out.
In a strong uptrend, MACD oscillates above zero. The signal line and MACD line will cross each other six, eight, or ten times during a sustained move. Selling each bearish crossover means shorting into trend strength repeatedly.
The problem is that the signal-line cross is computed from indicators of indicators (EMAs of EMAs). It is heavily smoothed and produces frequent crosses in calm markets and trending ones alike. Filter them: only act on signal-line crosses that occur when the MACD line is also crossing zero, or when divergence has already set up. Standalone signal-line crosses are too noisy to trade.
The other trap is treating extreme MACD readings as overbought or oversold. MACD is unbounded - it can read 5, or 25, or 100 depending on the price scale of the instrument. A reading of "high MACD" on Bitcoin in 2024 had no comparable meaning to "high MACD" on a $10 stock. There is no fixed level at which MACD becomes "too high" or "too low."
MACD vs other momentum indicators
vs RSI. RSI is bounded (0 to 100) and measures the ratio of gains to losses. MACD is unbounded and measures the gap between EMAs. RSI is better for spotting overbought / oversold context (with the trap from the RSI page); MACD is better for confirming trend direction and timing momentum shifts. Many traders run both - RSI on the chart, MACD in the pane below.
vs Stochastic. Stochastic measures where the close sits in the recent range and is fastest of the three. MACD lags more but is cleaner. Stochastic gives more signals in chop, MACD gives fewer but more meaningful signals in trends.
vs CCI. CCI is unbounded like MACD but measures deviation from the mean, not EMA spread. CCI swings further at extremes (+200, -300) and is favored for mean-reversion entries. MACD is for trend confirmation.
Common questions
Should I change the 12-26-9 settings? Almost never. The defaults are the universal coordination point - other traders, algorithms, and signal services all read MACD on those settings. Changing them means you are reading a different indicator than everyone else, which negates one of MACD's quiet advantages: that thousands of other participants are watching the same lines.
Does MACD work on intraday charts? Yes, but with less reliability. On 1-minute and 5-minute charts the signal-line cross is too noisy to trade. On the 15-minute and 1-hour charts it becomes usable. On the daily chart MACD divergence and zero-line crosses are at their most reliable.
What is the difference between MACD and the MACD histogram? The MACD line is the spread between the two EMAs. The histogram is the spread between the MACD line and the signal line. They are different measurements one level apart. The histogram leads the MACD line by a few bars in any momentum shift.
Why is MACD unbounded? Because it measures the absolute difference between two EMAs in the same units as price. A stock trading at 500 will have a MACD with larger absolute readings than one trading at 5, even with identical percentage moves. This is also why "compare MACD across two instruments" is a meaningless exercise.
Can I use MACD as a standalone trading system? No working trader does this. MACD generates too many false signals on its own. It is a confirmation tool that works alongside price structure, support and resistance, and at minimum one other indicator (typically a trend filter like the 200-EMA).
What about MACD on a logarithmic chart? The math is computed on the underlying close prices, not the chart's display scale. Switching the chart between linear and log does not change MACD readings.
When to use MACD and when not to
Use MACD when:
- You need confirmation of a trend change beyond visual reading of structure
- You are looking for momentum divergence on a daily or higher timeframe
- You want a clean trend-regime filter (above zero / below zero)
Skip MACD when:
- The market is range-bound and oscillating between clear support and resistance - MACD will produce a constant stream of false crosses
- You are scalping intraday on the 1- or 5-minute timeframe - the signal is too noisy to be tradeable
- You are already using multiple momentum indicators - MACD will not add information that RSI or Stochastic does not already give you
