TradeLabs AILearn

MACD

MACD tracks the gap between two EMAs to show trend and momentum. Learn the MACD line, signal line and histogram, crossovers, divergence and common pitfalls.

Beginner3 min readUpdated 3 Oct 2026
Markdown
Lesson 7 of 22

MACD, short for Moving Average Convergence Divergence, is a trend and momentum indicator built from two exponential moving averages. Gerald Appel developed it in the late 1970s, and Thomas Aspray added the histogram in 1986. MACD shows whether short term momentum is stronger or weaker than longer term momentum, and how that relationship is changing.

The three parts#

MACD line = EMA(12) − EMA(26)
Signal line = EMA(9) of the MACD line
Histogram = MACD line − Signal line
PartWhat it shows
MACD linePositive when the 12 period EMA is above the 26: short term momentum stronger than longer term
Signal lineA smoothed version of the MACD line, used for crossovers
HistogramThe gap between MACD and signal; growing bars mean momentum accelerating, shrinking bars mean it is fading
Zero lineWhere the two EMAs are equal

The default settings are 12, 26 and 9, from Appel's original work.

Main signals#

Signal line crossovers#

  • Bullish: MACD crosses above the signal line.
  • Bearish: MACD crosses below the signal line.

These are the most common signals and also the most frequent false signals in sideways markets.

Zero line crossovers#

MACD crossing above zero means the 12 period EMA has crossed above the 26: a slower, more significant trend signal. Crossing below zero is the bearish version.

Histogram changes#

The histogram often turns before the crossover. Shrinking bars warn that momentum is fading, giving an early hint that a crossover may follow.

Divergence#

  • Bearish divergence: price makes a higher high while MACD makes a lower high.
  • Bullish divergence: price makes a lower low while MACD makes a higher low.

As with RSI, divergence shows weakening momentum, not a guaranteed reversal. It is most useful at key levels and combined with structure. See RSI (Relative Strength Index).

Trading with MACD#

  1. Trend filter: favour long trades when MACD is above zero and short trades when below.
  2. Entry timing: within the trend direction, use signal line crossovers after pullbacks.
  3. Exit warnings: shrinking histogram bars or divergence can prompt tightening stops.
  4. Combine with structure: a bullish crossover at support after a pullback is stronger than one in the middle of a range.

MACD limitations#

  • Lag: it is built from moving averages, so signals come after moves begin.
  • Not bounded: unlike RSI, MACD has no fixed range, so "overbought" levels differ by market and price.
  • Whipsaws: in ranges, crossovers flip back and forth.
  • Comparing markets: MACD values depend on price level, so a reading of 2 means different things for a $20 stock and a $2,000 stock.

Settings#

The 12, 26, 9 default is standard. Some traders use faster settings such as 5, 35, 5 for quicker signals, or adapt to their timeframe. Test any change on data you did not use to choose it. See Overfitting and Curve Fitting.

Common mistakes#

  • Taking every crossover in sideways markets.
  • Ignoring the zero line and trend context.
  • Treating divergence as a trigger.

For a simpler momentum measure that compares today's price with a past price, see Rate of Change and Momentum.

Frequently asked questions#

What does MACD stand for?#

Moving Average Convergence Divergence: it tracks how two exponential moving averages move towards and away from each other.

What is a MACD crossover?#

When the MACD line crosses its signal line. Crossing above is considered bullish, crossing below bearish.

Is MACD better than RSI?#

They measure momentum differently. MACD is better at showing trend direction and changes; RSI is better at showing overbought and oversold extremes. Many traders use both.

Sources#

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonStochastic OscillatorThe stochastic oscillator shows where the close sits within the recent high low range. Learn %K and %D, overbought and oversold levels, crossovers and divergence.

Mentioned in