MACD
MACD is a momentum indicator built from two moving averages of price. It turns the gap between them into a line and a signal line whose crossings flag shifts in trend momentum.
MACD — short for Moving Average Convergence Divergence — is a momentum indicator that measures the relationship between two moving averages of a stock's price. When those averages pull apart or come together, MACD captures that as a single swinging line, making it easy to see when momentum is building or fading.
The three parts
- MACD line — the 12-day EMA minus the 26-day EMA. It rises when short-term momentum outpaces the longer term and falls when it lags.
- Signal line — a 9-day EMA of the MACD line. It is a smoothed version used as the trigger.
- Histogram — bars showing the gap between the MACD line and the signal line. They grow as momentum strengthens and shrink as it weakens.
These standard settings — 12, 26, and 9 — are why MACD is often written MACD(12,26,9). The zero line matters too: MACD above zero means the 12-day EMA is above the 26-day (short-term strength); below zero means the opposite.
How traders read it
- Signal-line crossover. MACD line crossing above the signal line is read as upward momentum; crossing below as downward. This is the basis of the MACD crossover strategy.
- Zero-line cross. MACD moving from below zero to above confirms a broader momentum shift.
- Histogram momentum. A shrinking histogram warns that a move is losing steam before the lines actually cross.
A worked example
The figures below are illustrative:
| Day | MACD line | Signal line | Histogram | Read |
|---|---|---|---|---|
| Mon | -0.30 | -0.15 | -0.15 | Below signal — weak |
| Tue | -0.05 | -0.12 | +0.07 | Crossover — momentum turning up |
| Wed | 0.18 | -0.02 | +0.20 | Strengthening |
| Thu | 0.30 | 0.10 | +0.20 | Confirmed uptrend |
On Tuesday the MACD line crosses above the signal line and the histogram flips positive — the moment a momentum trader watches for.
Limitations
- It lags. MACD is built from moving averages, so it confirms a move rather than predicting it.
- Whipsaws in flat markets. When a stock drifts sideways, the lines can cross back and forth, generating false signals.
Use MACD on PSX Algos
MACD, its signal line, and its histogram are all built-in indicators in the strategy builder. The MACD cross starter template wires *MACD crosses above signal* for you — add the histogram-above-zero confirmation and backtest it across a decade of PSX history before going live.
Build a MACD strategy →Frequently asked
What is MACD in simple terms?
MACD measures the gap between a stock's 12-day and 26-day moving averages. When its line crosses its signal line, it flags that trend momentum is shifting up or down.
What do 12, 26 and 9 mean?
They are the standard settings: the MACD line is the 12-day EMA minus the 26-day EMA, and the signal line is a 9-day EMA of the MACD line.
What is the MACD histogram?
It is the gap between the MACD line and the signal line, drawn as bars. It grows as momentum strengthens and shrinks as it fades, often warning of a turn early.
What is the difference between MACD and RSI?
MACD measures trend momentum from moving averages and is unbounded; RSI measures how overbought or oversold a stock is on a fixed 0–100 scale. Many traders use them together.