MarketInOut Stock Screener Log In | Sign Up

MACD (Moving Average Convergence/Divergence)

By MarketInOut · Updated October 29, 2026

MACD, short for Moving Average Convergence/Divergence, is a trend-following momentum indicator. It shows the gap between a fast and a slow exponential moving average, and how that gap is changing. Gerald Appel developed it in the late 1970s; the MACD histogram was added later by Thomas Aspray. Because it combines trend and momentum in one display, it is one of the most popular indicators in charting software.

How MACD is calculated

MACD has three parts, usually with the settings 12, 26 and 9:

MACD line   = EMA(12) - EMA(26)          (of closing prices)
Signal line = EMA(9) of the MACD line
Histogram   = MACD line - Signal line

When the fast average is above the slow one, MACD is positive and the short-term trend is up. When the two averages move apart, MACD grows (divergence of the averages); when they move together, it shrinks (convergence), which gives the indicator its name.

How to read MACD

  • Signal line crossovers. MACD crossing above its signal line is a bullish signal, and crossing below is bearish. These are the most frequent MACD signals and also the most prone to whipsaws.
  • Zero-line crossovers. MACD crossing above zero means the 12-day EMA has crossed above the 26-day EMA. It is slower but confirms a change in trend.
  • The histogram. It shows the distance between MACD and its signal line. A shrinking histogram means momentum is fading before the lines actually cross, so it gives an earlier warning.
  • Divergence. Price makes a new high while MACD makes a lower high, or price makes a new low while MACD makes a higher low. Like all divergences, it warns of weakening momentum rather than timing a reversal.
  • Context. A bullish crossover below zero, inside a longer-term uptrend, is a classic pullback-buying setup: momentum turns up while the larger trend is intact.

Settings and common mistakes

  • Settings. 12, 26, 9 are the defaults. Shorter settings react faster but whipsaw more. Many traders use the defaults on weekly charts for longer-term trend signals.
  • Trading every crossover in a sideways market. MACD is built from moving averages, so it works in trends and gives many false signals in ranges. A trend filter or ADX helps.
  • Comparing MACD values across stocks. MACD is measured in price units, so a value of 2 means something different for a $20 stock and a $500 stock. Compare signals, not raw values. The percentage price oscillator (PPO) is the normalized version.

SPY (SandP 500 ETF), daily, with MACD(12,26,9).

Live chart: SPY (S&P 500 ETF), daily, with MACD(12,26,9). The chart updates every trading day.

Screen for it on MarketInOut

Our formula language has macd(), macds() for the signal line and macdh() for the histogram. Bullish signal line crossovers:

exch(nyse,nasdaq) and type(stock) and price > 1 and advol(21) > 1
and macd(12,26,9) ca macds(12,26,9)

The pullback setup: a bullish crossover below zero in stocks above their 200-day average:

exch(nyse,nasdaq) and type(stock) and price > 1 and advol(21) > 1
and price > sma(200) and macd(12,26,9) ca macds(12,26,9) and macd(12,26,9) < 0

Related: Moving averages, Relative Strength Index, ADX and directional movement.




Disclaimer - Privacy Policy - Terms of Service - Cookies - FAQ - Affiliates - Blog