11 — Trend & Momentum

MACD#

Debated1 min read
◆ The PatternMomentum as the gap between a fast and a slow average, and how that gap is changing

The Moving Average Convergence Divergence — Gerald Appel's trend-momentum hybrid (1979).

MACD Line = EMA(12) − EMA(26)
Signal Line = EMA(9) of MACD
Histogram = MACD − Signal
Three signals:
1. Signal crossover: MACD crosses above Signal → buy; below → sell
2. Zero-line crossover: MACD crosses above zero → bullish trend
3. Divergence: Price makes new high but MACD doesn't → weakening momentum

The histogram shows the rate of change of the MACD/Signal relationship — when bars shrink, a crossover is coming.

Worked example

With fast 3, slow 6 and signal 3 (the standard 12/26/9 needs more than 15 days). MACD peaked at 1.77 on day 7 with the rally. The histogram turned negative on day 8 (−0.03), the first down day after the peak, and back to positive on day 15 (+0.44), one day into the rebound.

The example data: 15 days, used in every indicator here
DayHighLowCloseVolume
11019910050,000
210310010262,000
310310010148,000
410510110470,000
510810410785,000
610810510660,000
711010610990,000
811010710872,000
910810410580,000
1010510210366,000
1110510210455,000
1210410110275,000
13102989995,000
141029910164,000
1510510110471,000
Where it misleads
  • Both lines come from lagging averages, so crossovers confirm turns rather than anticipate them.
  • In a sideways market MACD hovers around zero and produces a crossover every few bars.
  • Values are in price units, so readings cannot be compared across assets, or across very different price levels, without scaling.
In code
fast = df['close'].ewm(span=3, adjust=False).mean()
slow = df['close'].ewm(span=6, adjust=False).mean()
df['macd'] = fast - slow
df['signal'] = df['macd'].ewm(span=3, adjust=False).mean()
df['hist'] = df['macd'] - df['signal']
Python, in your browser — edit the code and run it again

Assumes import numpy as np, import pandas as pd, and a DataFrame df with columns high, low, close and volume — the 15 days above.

Sources
  • G. Appel, Technical Analysis: Power Tools for Active Investors, FT Prentice Hall, 2005
  • C.-H. Park & S. H. Irwin, “What Do We Know About the Profitability of Technical Analysis?”, Journal of Economic Surveys 21(4), 2007 — a review of the evidence across studies

Last reviewed October 2026 · How this site checks its content · Report a mistake

Check yourself

1. What is the MACD line?

Show answer

B. The signal line is a 9-period EMA of the MACD line.

2. What does the MACD histogram show?

Show answer

A. The histogram shrinks before a crossover, which is why some traders watch it for early warning.

3. Why do MACD crossovers often come late?

Show answer

B. Every smoothing step trades noise for lag. Signals confirm moves that have already started.

Pattern bridge: The difference between two EMAs is a residual — what the fast signal sees that the slow one doesn’t. The same fast-minus-slow construction applied to volume flow is the Chaikin oscillator.
Performance in practice
  • Crossovers work better in trends than in ranges; an ADX filter (e.g. trade only when ADX > 25) is a common way to skip choppy periods — test it rather than assume it
  • Histogram divergences are a popular early warning, but they also persist through many trends that never reverse
  • Gerald Appel introduced MACD in the late 1970s; the 12/26/9 defaults are convention, not optimised values — re-tuning them on your own data is a search with all the risks of one
When to use this
✓ Use when: Trending markets with clear directional moves. As a momentum confirmation alongside price action. Histogram divergences for early reversal warnings. Medium-term swing trading.
✗ Skip when: Choppy, range-bound markets (many false signals). Very short timeframes (1-5 min). When you need a leading indicator — MACD is lagging by design. As your sole entry trigger.
Linked from 4
← Previous
Rate of Change
Open in the full reader, with the topic sidebar