MACD (Moving Average Convergence Divergence)¶
Difficulty beginner
Definition¶
MACD shows the relationship between two moving averages of price. It's both a trend-following and momentum indicator.
price
│ ╱╲ ╱╲
│ ╱ ╲ ╱ ╲╲
│ ╱╲ ╱ ╲ ╲╲
│ ──── EMA12 ╱ ╲ ╱ EMA26 ╲────
│ ────── ─ ─╱ ─ ─ ╲╱ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╲─
│ ╱
└──────────────────────────────────────────────────────→ time
MACD
│ ↑ bullish crossover ↓ bearish crossover
│ ╱╲ ╱ signal ╱╲ ╱
│ ╱ ╲ ╱ ╳ signal
0│ ─ ─ ─╱─ ─ ─ ─╲─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╲─ ─ ─ ─ ─ ─ zero line
│ ╱ ╲ ╲
│ ╱ ╲ ╲
│ histogram (MACD − signal)
│ ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁ ─ ─ ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁
└──────────────────────────────────────────────────────→ time
buy signal sell signal
Calculation¶
MACD Line = EMA(12) - EMA(26)
Signal Line = EMA(MACD, 9)
Histogram = MACD Line - Signal Line
Default parameters: 12, 26, 9
where:
EMA(n)exponential moving average of close overnperiods ·MACD Linedifference between fast and slow EMA — proxy for short-term momentum versus long-term trend ·Signal Line9-period EMA of the MACD Line, a smoothed trigger ·HistogramMACD Line minus Signal Line, the rate of change of the spread. does: converts the gap between a fast and slow EMA into an oscillator around zero — positive values mean short-term momentum leads the longer trend, negative values mean it lags. Traders enter long on a MACD-above-Signal cross (especially while MACD is above zero), short on the inverse, and treat histogram expansion as confirmation that momentum is accelerating. Divergence between price and the MACD Line is the higher-quality signal — used to anticipate reversals before the crossover prints.
Trading Signals¶
Crossover¶
Bullish: MACD crosses above Signal line Bearish: MACD crosses below Signal line
Zero Line Cross¶
Bullish: MACD crosses above zero (short-term MA above long-term MA) Bearish: MACD crosses below zero
Divergence¶
Bullish: Price makes lower low, MACD makes higher low Bearish: Price makes higher high, MACD makes lower high
Histogram¶
- Rising histogram → momentum increasing
- Falling histogram → momentum decreasing
- Histogram reversal → potential entry/exit
Practical Guidelines¶
- Trend Filter — Use higher TF trend to filter signals
- Divergence Over Crossover — More reliable than simple crosses
- Histogram First — Often signals before the crossover
- Ranging Markets — MACD generates false signals in ranges
- Combine with RSI — Both momentum, different calculations
Next Steps¶
- Bollinger Bands — Volatility bands
- ATR — Average True Range