MACD (moving average convergence divergence)

Updated November 30, 2026 · One of the 11 oscillators in TradingView's technical rating

MACD, short for moving average convergence divergence, measures the gap between a fast and a slow exponential moving average. When the fast average pulls away above the slow one, upward momentum is building; when it falls toward or below it, momentum is fading or turning down. Gerald Appel created MACD in the 1970s, and in 1986 Thomas Aspray added the histogram that most charts now show with it.

At a glance

TypeTrend-following momentum indicator, unbounded
Created byGerald Appel (1970s); histogram added by Thomas Aspray (1986)
Standard settings12, 26, 9
Three partsMACD line, signal line, histogram
TradingView ratingBuy if the MACD line is above the signal line; Sell if below

How it’s calculated

MACD line   = 12-period EMA of the close − 26-period EMA of the close
Signal line = 9-period EMA of the MACD line
Histogram   = MACD line − signal line

Each EMA updates with its own weight, k = 2 ÷ (n + 1):

  • 12-period EMA: k = 2/13 = 0.1538
  • 26-period EMA: k = 2/27 = 0.0741
  • 9-period signal line: k = 2/10 = 0.2

MACD is measured in price units, so a stock at $500 has much bigger MACD values than one at $20. Compare a market’s MACD with its own history, not with other markets’.

Worked example: four days and a crossover

Start from yesterday’s values for a hypothetical stock (day 0): 12-day EMA 101.80, 26-day EMA 100.95, so the MACD line is 0.85; the signal line is 0.70 and the histogram +0.15.

Day 1: the stock closes at 103.40.

  • 12-day EMA = 103.40 × 2/13 + 101.80 × 11/13 = 15.9077 + 86.1385 = 102.0462
  • 26-day EMA = 103.40 × 2/27 + 100.95 × 25/27 = 7.6593 + 93.4722 = 101.1315
  • MACD line = 102.0462 − 101.1315 = 0.9147
  • Signal line = 0.9147 × 0.2 + 0.70 × 0.8 = 0.1829 + 0.5600 = 0.7429
  • Histogram = 0.9147 − 0.7429 = +0.1717

The next three days, calculated the same way:

DayClose12-day EMA26-day EMAMACD lineSignal lineHistogramTradingView reading
0101.8000100.95000.85000.7000+0.1500Buy
1103.40102.0462101.13150.91470.7429+0.1717Buy
2101.20101.9160101.13660.77940.7502+0.0292Buy
3100.10101.6366101.05980.57680.7155−0.1387Sell
499.60101.3233100.95160.37160.6468−0.2751Sell

What happened:

  • On day 2 the close fell, the MACD line dropped, and the histogram shrank from +0.17 to +0.03: momentum was fading even though the reading stayed Buy.
  • On day 3 the MACD line (0.5768) fell below the signal line (0.7155). That is a bearish crossover, and TradingView’s reading flips to Sell.
  • The MACD line is still above zero on days 3 and 4, meaning the 12-day EMA is still above the 26-day EMA. The rating ignores the zero line entirely; it only compares the MACD line with the signal line.

How traders read MACD

TradingView’s help page lists the common readings:

  • Above or below zero. MACD above zero means the fast average is above the slow one, suggesting upward momentum or an uptrend; below zero suggests a downtrend.
  • Signal-line crossovers. The MACD line crossing above the signal line, or a histogram turning positive, suggests upward momentum is increasing or downward momentum decreasing. Crossing below suggests the reverse.
  • The histogram. Growing bars mean the gap between MACD and its signal line is widening; shrinking bars, as on day 2 above, often come before a crossover.
  • Divergence. Falling MACD peaks while price rises can point to an uptrend running out of steam; rising MACD lows while price falls can point to a downtrend weakening.

How TradingView’s rating uses it

MACD (12, 26, 9) is one of the 11 oscillators in TradingView’s rating:

ReadingCondition
Buy (+1)MACD line above the signal line
Sell (−1)MACD line below the signal line
Neutral (0)MACD line equal to the signal line

Because the lines are almost never exactly equal, MACD nearly always counts as Buy or Sell, unlike RSI or Stochastic, which are Neutral most of the time.

Settings and variations

  • Lengths. 12, 26, 9 is the standard. Faster settings react sooner with more false crossovers.
  • Average type. TradingView’s MACD settings let you switch the averages from EMA to SMA, for the two main averages and for the signal line separately. That changes all the values.

Limitations

  • It lags. MACD is made of moving averages, so crossovers come after the price has already turned.
  • Whipsaws in flat markets. When prices move sideways, the lines cross back and forth.
  • No fixed overbought level. Because MACD is unbounded and in price units, there is no universal “too high” value.

See it on a live chart

MACD (12, 26, 9) under daily candles. The legend shows three values: the histogram, the MACD line and the signal line.

For TradingView's current rating of any market, with this indicator among the 26, see the market analysis page or the technical signals for all markets.

Sources

This page explains how an indicator is calculated and how traders commonly read it. The worked examples use hypothetical prices. Nothing here is a recommendation to buy or sell any investment. This content is for informational purposes only and does not constitute financial advice. Consult a qualified financial advisor before making investment or financial decisions.