Skip to main content
PSX Algos

MACD

In one line

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

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

A worked example

The figures below are illustrative:

DayMACD lineSignal lineHistogramRead
Mon-0.30-0.15-0.15Below signal — weak
Tue-0.05-0.12+0.07Crossover — momentum turning up
Wed0.18-0.02+0.20Strengthening
Thu0.300.10+0.20Confirmed uptrend
Illustrative MACD turning up through its signal line.

On Tuesday the MACD line crosses above the signal line and the histogram flips positive — the moment a momentum trader watches for.

Limitations

MACD pairs well with a momentum oscillator like RSI: MACD shows trend momentum, RSI shows whether the move is already stretched.

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.

Related terms
MACD Crossover strategySMA vs EMARSI (Relative Strength Index)Golden Cross strategy
By PSX Algos · Updated 14 June 2026