MACDMACD

MACD (Moving Average Convergence Divergence) tracks the gap between two exponential moving averages to show changes in a trend's momentum.

MACD takes two moving averages — a fast one and a slow one — and plots the distance between them.1 When the fast average pulls away above the slow one, upward momentum is building; when the gap narrows, it is fading. A second line and a histogram turn that into signals. MACD is one of the most popular indicators because it combines trend and momentum in one panel, but it inherits the lag of the averages it is made from.

Category
Indicators and Tools
Reading time
6 min
Also called
Moving Average Convergence Divergence, MACD line, Signal line
Updated

MACD in plain words

Imagine two runners on the same track: a sprinter (the 12-period EMA) and a steady jogger (the 26-period EMA). When the price speeds up, the sprinter pulls ahead and the gap between them grows. When the price slows, the sprinter falls back towards the jogger. MACD is that gap.2

A third line, the signal line, is a 9-period average of the MACD itself. When MACD crosses above it, momentum is turning up; when it crosses below, momentum is turning down.2

How to build and read MACD, step by step

  1. Calculate the MACD line

    Subtract the 26-period EMA from the 12-period EMA. Positive means the fast average is above the slow one.2 See Moving Average.

  2. Add the signal line

    Take a 9-period EMA of the MACD line.2

  3. Plot the histogram

    The histogram is MACD minus the signal line. Growing bars mean momentum is accelerating; shrinking bars mean it is slowing.

  4. Read the zero line

    MACD crossing above zero is considered bullish and below zero bearish — it means the fast average has crossed the slow one.2

  5. Read the signal-line crosses

    MACD crossing above the signal line is considered bullish, and below it bearish.2

  6. Check the market type

    In trading ranges MACD whipsaws back and forth across the signal line; many users avoid its signals there.2

Worked examples

Example 1 — Reading one day’s values

Bullish

A stock’s 12-day EMA is $52.40 and its 26-day EMA is $51.10. The signal line (9-day EMA of MACD) is 1.05.

Example 1 — Reading one day’s values — calculation
MACD = 12 EMA − 26 EMA$52.40 − $51.10 = 1.30
Histogram = MACD − signal1.30 − 1.05 = +0.25
ReadingAbove zero and above the signal line

The fast average is above the slow one and MACD is above its signal: upward momentum, for now.

Example 2 — Momentum fading before the cross

Fading

Over the next three days MACD goes 1.30 → 1.22 → 1.15 while the signal line goes 1.05 → 1.08 → 1.10.

Example 2 — Momentum fading before the cross — calculation
Histogram+0.25 → +0.14 → +0.05
PriceStill rising slightly
ReadingMomentum slowing; a bearish cross is close

The shrinking histogram warned before the lines actually crossed. Some traders tighten stops at this stage rather than waiting for the cross.

Example 3 — Whipsaw in a range

Whipsaw

A stock trades sideways between $48 and $52 for six weeks. MACD crosses its signal line six times. A trader takes every cross, losing about $0.70 a share on four trades and making $0.90 on two.

Example 3 — Whipsaw in a range — calculation
Losses4 × −$0.70 = −$2.80
Gains2 × +$0.90 = +$1.80
Net per share−$1.00

MACD is a trend tool. In ranges its crosses come late and reverse quickly, which is why many traders ignore them there.2

Figure 1

Price with MACD, signal line and histogram

Price with MACD, signal line and histogramThe upper panel shows the price. The lower panel shows the MACD line (12-period EMA minus 26-period EMA), its 9-period signal line and a histogram of the gap between them. The MACD line crosses above zero as the price rises and below zero as it falls; the histogram shrinks before each crossover of the two lines.PriceMACD (12, 26, 9)zero lineMACDSignaltime →
MACD (12-period EMA minus 26-period EMA), its 9-period signal line and the histogram of the gap between them. The histogram shrinks before each crossover.

MACD signals at a glance

AspectUsually read asWatch out for
MACD crosses above signalMomentum turning up2Late in fast moves; whipsaws in ranges
MACD crosses below signalMomentum turning down2Same
MACD crosses above zeroFast EMA above slow EMA — uptrend2Arrives well after the turn
Histogram shrinkingMomentum slowingNot a reversal by itself
Divergence with priceMove losing strengthStronger when it confirms a crossover2

How traders use MACD

  • Trend confirmation

    MACD above zero supports long trades in an uptrend; below zero supports shorts in a downtrend. See Trend.

  • Timing entries

    Some traders wait for a signal-line cross in the direction of the larger trend after a pullback.

  • Early warning

    A shrinking histogram or a divergence can prompt tighter stops or partial profits. See Divergence.

  • Comparing momentum

    Unlike the RSI, MACD has no fixed range, so it measures direction and acceleration rather than “overbought”.

Advantages and disadvantages

Advantages

  • Combines trend direction and momentum in one panel.
  • Clear, rule-based signals.
  • The histogram shows changes in momentum before the lines cross.

Disadvantages

  • Lags price, because it is built from moving averages.
  • Whipsaws in sideways markets.2
  • Values are in price units, so they cannot be compared across assets of different prices.
  • Not designed to identify overbought or oversold conditions.2

Going deeper

Read as far as you need. Each level builds on the one before it.

Three parts, one idea

Beginner

The MACD line, the signal line and the histogram all describe the same thing — the gap between a fast and a slow average — at different levels of smoothing.

Settings

Intermediate

12, 26 and 9 are the defaults and can be adjusted.2 Shorter settings react faster with more false signals; longer ones are smoother and later. On weekly charts many traders keep the defaults; intraday traders sometimes shorten them.

Why MACD has no fixed scale

Advanced

Because MACD is a difference in price, a $500 stock produces much larger values than a $20 stock with the same percentage moves. A percentage version (the percentage price oscillator, PPO) divides by the slow EMA so that values can be compared across assets and over long periods when price has changed a lot.

Common mistakes

  1. Taking every crossover

    In ranges most crosses are noise. Check the trend and the market type first.

  2. Treating MACD as overbought or oversold

    MACD has no bounds; a high value only means a strong trend so far.

  3. Comparing values between stocks

    MACD is in price units. Compare an asset only with its own MACD history.

  4. Forgetting the lag

    By the time MACD crosses zero, much of the move has often happened.

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q112-period EMA = $30.50, 26-period EMA = $31.20. What is MACD, and what does it mean?
Q2MACD = 0.80, signal = 0.95. What is the histogram value?

Key points to remember

  1. MACD = 12-period EMA − 26-period EMA; the signal line is a 9-period EMA of MACD.
  2. The histogram (MACD − signal) shows whether momentum is speeding up or slowing down.
  3. Crosses above the signal line or zero are read as bullish; below as bearish.
  4. MACD works in trends and whipsaws in ranges.
  5. It has no fixed scale and is not an overbought/oversold tool.

Frequently asked questions

What are the best MACD settings?

12, 26 and 9 are the standard defaults and work for most traders. Changing them trades responsiveness for more false signals, or smoothness for more lag.

Is MACD a leading or lagging indicator?

Lagging. It is built from moving averages, so it confirms momentum after price has moved. The histogram turns earlier than the crossovers, but it still follows price.

What is the difference between MACD and RSI?

RSI is bounded from 0 to 100 and compares the size of gains and losses. MACD is unbounded and measures the gap between two moving averages. Many traders use one for trend and the other for timing.

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. StockCharts ChartSchool. MACD (Moving Average Convergence/Divergence Oscillator) (opens in a new tab) Checked .
  2. Fidelity. MACD (Moving Average Convergence/Divergence) (opens in a new tab) Checked .

Read more elsewhere

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. Trading Metrics is our sister site, under the same ownership; we are not affiliated with any other publisher linked above. Last reviewed . Report an error or request a source credit.