TL;DR. MACD (Moving Average Convergence Divergence) is a momentum-and-trend indicator built from three exponential moving averages of price. It signals when short-term momentum is accelerating away from — or converging back toward — the longer-term trend. Its formula is simple, its default settings (12, 26, 9) have not changed in nearly fifty years, and it is one of the most widely used indicators in technical analysis. It is also one of the most abused: MACD produces frequent false signals in sideways markets, lags fast reversals, and has no fixed “overbought” level. This piece walks through the math, a worked example, the three signals traders actually watch, and where the indicator quietly misleads you.
What MACD is (and what it isn’t)
MACD stands for Moving Average Convergence Divergence. It was created by trader and money manager Gerald Appel in the late 1970s, and the default parameters he chose — 12, 26, and 9 periods — remain the industry standard today (Wikipedia: MACD).
MACD is often labelled a “momentum oscillator,” but it behaves as a hybrid trend/momentum tool. Unlike RSI or the stochastic oscillator, MACD is unbounded — its value can, in theory, drift arbitrarily far from zero on very volatile names. That single design choice matters: MACD tells you when momentum is changing, not whether an asset is “overbought” or “oversold.” Treating it as the latter is one of the most common mistakes we cover below.
The U.S. Securities and Exchange Commission’s investor-education arm reminds retail investors that technical indicators analyse past price patterns and are not, on their own, forecasts of future returns (SEC investor glossary).
The formula, line by line
MACD has three components, each built on the previous one:
- MACD Line = 12-period Exponential Moving Average (EMA) of price − 26-period EMA of price.
- Signal Line = 9-period EMA of the MACD Line.
- Histogram = MACD Line − Signal Line.
Fidelity’s technical-indicator guide describes the calculation in the same terms: “An approximated MACD can be calculated by subtracting the value of a 26 period Exponential Moving Average (EMA) from a 12 period EMA. A signal line is created with a 9 period EMA of the MACD line” (Fidelity Learning Center).
The EMA is a weighted moving average that puts more weight on recent prices. Fidelity gives the recursive form as:
EMAtoday = K × (Closetoday − EMAyesterday) + EMAyesterday
where K is a smoothing constant. By industry convention, K = 2 / (N + 1) for an N-period EMA — so a 12-period EMA weights the most recent close by roughly 15.4%, a 26-period by 7.4%, and a 9-period by 20%. That decreasing weight is why MACD reacts faster than a simple-moving-average crossover system: newer prices simply matter more (Fidelity: EMA).
Why 12, 26, and 9?
When Appel designed the indicator, U.S. equity markets traded a six-day week. In that world, 12 sessions ≈ 2 weeks, 26 sessions ≈ 1 month, and 9 sessions ≈ 1.5 weeks. The five-day trading week arrived, but the parameters stuck (Wikipedia: MACD). There is nothing sacred about them — shorter-term traders often use MACD(5, 35, 5), and intraday systems tune periods to the bar size — but 12/26/9 is what every charting package defaults to and what most published research studies.
A worked example
Suppose a stock closes at 100, 102, 101, 104, 106 over five sessions. Assume the prior 12-day EMA sits at 99.50, the prior 26-day EMA at 98.20, and the prior 9-period EMA of MACD (the signal line) at 1.20. Using K12 = 2/13 ≈ 0.1538, K26 = 2/27 ≈ 0.0741, and K9 = 2/10 = 0.20, each row below applies the recursive EMA formula to yesterday’s EMA and today’s close.
| Day | Close | 12-EMA | 26-EMA | MACD Line | Signal (9-EMA) | Histogram |
|---|---|---|---|---|---|---|
| 0 (prior) | — | 99.50 | 98.20 | 1.30 | 1.20 | +0.10 |
| 1 | 100.00 | 99.58 | 98.33 | 1.25 | 1.21 | +0.04 |
| 2 | 102.00 | 99.95 | 98.61 | 1.34 | 1.24 | +0.10 |
| 3 | 101.00 | 100.11 | 98.78 | 1.33 | 1.25 | +0.08 |
| 4 | 104.00 | 100.71 | 99.17 | 1.54 | 1.31 | +0.23 |
| 5 | 106.00 | 101.52 | 99.68 | 1.85 | 1.42 | +0.43 |
Notice how the histogram accelerates from +0.04 on Day 1 to +0.43 on Day 5. That widening histogram is the textbook signal that momentum is building. It is not, by itself, a signal to buy — it is a signal that the two averages are diverging in the same direction as price. What you do with that information is your strategy; MACD is only the input.
How MACD is built, visually
The three signals traders actually watch
Practitioners typically read MACD three ways. Each has a distinct signal-to-noise trade-off.
1. Signal-line crossover
The MACD line crossing above the signal line is called a bullish crossover; crossing below is bearish. This is the most-cited MACD signal and also the noisiest — it fires many times per year on any liquid name.
2. Zero-line crossover
MACD crossing above zero means the 12-EMA has moved above the 26-EMA — the short-term average is now higher than the long-term average, a classic trend confirmation. Crossings below zero are the mirror. This signal fires less often but tends to catch larger, cleaner moves.
3. Divergence
When price makes a new high but MACD does not, that is bearish divergence: momentum is slowing even as price extends. The mirror pattern (lower price low, higher MACD low) is bullish divergence. Divergence is the MACD signal favoured by discretionary traders, and the one most cherry-picked in hindsight.
MACD in action: a bullish crossover
The bullish crossover shown above precedes most of the price move — the ideal case cited in every textbook. In practice, that clarity is the exception, not the rule.
Where MACD quietly misleads you
- Whipsaws in ranging markets. When price chops sideways, the 12- and 26-EMAs cross repeatedly. Every crossover looks like a signal; most are noise. This is why MACD-only systems perform badly in low-volatility, trend-less regimes.
- It is a lagging indicator. Every input is a moving average, and moving averages by construction react after price. In fast reversals, MACD confirms the turn only when much of the move is already over.
- Divergence can persist for a long time. A stock in a strong trend can print bearish MACD divergence for weeks before actually rolling over — or never roll over at all. Divergence is a warning, not a trigger.
- There is no fixed “overbought.” MACD is unbounded. A “high” reading on a high-beta name like Nvidia looks nothing like a “high” reading on Coca-Cola. Applying a hard threshold across tickers rarely works.
- Parameter overfitting. Optimize MACD’s periods on historical data and you will find a setting that looks great in-sample and fails out-of-sample. The 12/26/9 default is not laziness — it is the setting most studied and least overfit.
How to read the histogram
A rising histogram (above or below zero) means the MACD line is pulling away from the signal line — momentum accelerating. A shrinking histogram means the two lines are converging — momentum fading, often before the MACD line itself crosses the signal. Many traders watch the histogram as the “earliest” MACD signal, at the cost of also getting the most false positives.
What to learn next
MACD sits in a family of trend-following momentum tools. Once the mechanics click, the natural next reads are:
- The Relative Strength Index (RSI), a bounded momentum oscillator that pairs well with MACD because it is a legitimate overbought/oversold gauge.
- Simple vs. exponential moving averages, and why the exponential weighting under the hood of MACD changes its lag characteristics.
- Divergence more broadly — classic vs. hidden divergence, and how practitioners quantify it instead of eyeballing charts.
None of these tools works in isolation. Every professional technician who uses MACD combines it with price structure, volume, and a risk-management rule set that decides what to do after a signal fires. MACD tells you when momentum shifts; it does not tell you how much to risk on that shift.
Sources
- Wikipedia: MACD (Moving Average Convergence Divergence) — formulas, creator (Gerald Appel, late 1970s), default 12/26/9 settings.
- Fidelity Learning Center: MACD indicator guide — formula and interpretation used by U.S. retail brokerage clients.
- Fidelity Learning Center: Exponential Moving Average (EMA) — recursive EMA formula with smoothing constant.
- SEC Investor.gov: Technical Analysis glossary entry — U.S. regulator’s definition of technical analysis.
Disclosure: This article is for informational purposes only and is not investment advice.