Skip to content
On this page
  1. Key Takeaways
  2. What It Is
  3. The Intuition
  4. How It Works
  5. Worked Example
  6. Common Mistakes
  7. Frequently Asked Questions
  8. Sources
  9. Disclaimer
← All concepts
Technical AnalysisIntermediate5 min read

MACD: Momentum and Trend in One Indicator

MACD, short for Moving Average Convergence Divergence, is a momentum and trend indicator built from two exponential moving averages. It was created by Gerald Appel in the late 1970s and remains one of the most widely used tools on modern charts.

Key Takeaways

  • MACD plots the difference between a 12-period and 26-period EMA; a 9-period EMA of that difference is the signal line.
  • The histogram measures the rate of change of momentum, not price direction, and often diverges from price before a reversal.
  • MACD crossovers in sideways markets generate too many false signals to trade without a trend filter such as the zero line or the 200-day SMA.
  • MACD works best in trending markets where its momentum acceleration signals align with the broader directional move.

Key Takeaways

  • MACD plots the difference between a 12-period and 26-period EMA; a 9-period EMA of that difference is the signal line.
  • The histogram measures the rate of change of momentum, not price direction, and often diverges from price before a reversal.
  • MACD crossovers in sideways markets generate too many false signals to trade without a trend filter such as the zero line or the 200-day SMA.
  • MACD works best in trending markets where its momentum acceleration signals align with the broader directional move.

What It Is

MACD plots the difference between a fast exponential moving average and a slow one as a single oscillating line. A second line, called the signal line, is an EMA of that difference. A histogram plots the gap between the two lines.

The default settings are 12, 26, and 9. A 12-period EMA minus a 26-period EMA gives the MACD line. A 9-period EMA of that result gives the signal line. The histogram is MACD minus signal. Those three components together tell you both the direction of the trend and whether momentum is accelerating or decelerating.

The Intuition

A short-window EMA tracks price closely. A long-window EMA tracks it loosely. The gap between them is essentially a measure of how fast the short-term trend is pulling away from, or falling back toward, the long-term trend.

When the fast EMA is well above the slow one and rising, price is in a strong uptrend and gaining speed. When the two EMAs converge, momentum is cooling. When the fast one crosses below, the trend has flipped and momentum has gone negative. MACD encodes all of that in one chart panel, which is why traders have kept it on their screens for forty years.

How It Works

Three quantities are computed each bar:

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

The MACD line crosses the zero line when the fast EMA crosses the slow EMA. That is the same event as a short-term moving average crossover on price itself, just plotted as a single number. A MACD line above zero means the 12-EMA is above the 26-EMA, which is typically read as an uptrend. Below zero is the inverse.

The signal line cross is the second event traders watch. When the MACD line crosses above its 9-period signal line, momentum is rolling higher, even if the MACD line is still below zero. When the MACD line crosses below the signal line, short-term momentum is rolling over.

The histogram visualises the gap between MACD and signal. When the histogram is rising, momentum is accelerating in the MACD line's direction. When it is shrinking, momentum is fading even if MACD has not yet crossed. StockCharts describes the histogram as an oscillator around the MACD line's own signal, which is why divergences between price and the histogram often precede reversals.

The 12, 26, 9 defaults are conventions, not physics. Shorter settings like 5, 35, 5 react faster and generate more signals. Longer settings filter noise but lag further. Intraday traders often use shorter inputs, while swing and position traders stick close to the defaults.

Worked Example

Suppose a stock has been in a steady uptrend. The 12-day EMA is 105 and the 26-day EMA is 100, giving a MACD line of +5. The 9-day EMA of MACD, the signal line, sits at +3. The histogram is +2.

Now price stalls and drifts sideways for two weeks. The 12-day EMA pulls in to 103, the 26-day EMA drifts up to 101, so MACD falls to +2. The signal line, smoothed at 9 periods, is still catching up at +3. The histogram is now -1. MACD has crossed below its signal line even though MACD is still positive and the 12-EMA is still above the 26-EMA.

That is the classic bearish signal line cross in an uptrend. Momentum is cooling, and the histogram flipped first. A trader using MACD would not necessarily short here, but might tighten stops or stop adding to the long position. If price then rolls over and MACD crosses below zero, both events have lined up: trend direction and momentum agree.

Common Mistakes

  1. Treating every MACD cross as a trade. MACD generates signal-line crossovers constantly in sideways markets, and most of them fail. A common filter is to only take crosses that happen in the same direction as the larger trend, for example only taking bullish signal crosses while MACD itself is above zero.

  2. Ignoring the larger trend. MACD is drawn from price, so it tends to chop around in range-bound conditions and shine in trending ones. Running MACD signals without a trend filter, such as the 200-day moving average on price or MACD's own zero-line, is the fastest way to accumulate false signals.

  3. Misreading the histogram. A rising histogram does not mean price is rising, only that the gap between MACD and its signal is widening. Price can be flat or even falling while the histogram builds. The histogram measures the rate of change of momentum, not price itself.

  4. Chasing divergence without confirmation. Bullish divergence, where price makes a lower low but MACD makes a higher low, is a popular setup but often fires early. Waiting for a signal-line cross or a zero-line cross to confirm the divergence catches fewer tops and bottoms but avoids more losers.

  5. Changing the parameters to fit past data. Tuning 12, 26, 9 into some custom 8, 21, 5 because it looked better on last year's chart is curve-fitting. If you change the defaults, do so because your trading horizon genuinely differs, not because the tuned version backtests nicely.

Frequently Asked Questions

Q: What is MACD in simple terms? MACD is a chart indicator that shows whether short-term price momentum is accelerating or decelerating relative to the longer-term trend. It is built by subtracting a slow moving average from a fast one and plotting the result as a line around zero.

Q: How does MACD affect investment decisions? When the MACD line crosses above its signal line while MACD is above zero, momentum is strengthening in an uptrend, a signal to hold or add. When it crosses below the signal line, momentum is cooling, prompting a review of stop levels or position sizing.

Q: What is a real-world example of a MACD signal? In late 2022, the S&P 500's MACD crossed above its signal line while still below zero, then the MACD line itself crossed above zero weeks later. Traders using both events as confirmation got an early alert that the bear market momentum was fading before the price fully recovered.

Q: How can investors use MACD practically? Only take signal-line crosses that align with the zero-line direction: bullish crosses when MACD is above zero, bearish crosses when it is below. A simple rule: a MACD cross that disagrees with the zero line's position is a warning sign, not an entry trigger.

Q: How is MACD different from RSI? MACD measures the gap between two moving averages and is unbounded, making it better for identifying trend direction and acceleration. RSI measures the ratio of up moves to down moves on a 0–100 scale, making it better for spotting overbought and oversold extremes.

Sources

  1. StockCharts ChartSchool. "MACD (Moving Average Convergence/Divergence) Oscillator." https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-indicators/macd-moving-average-convergence-divergence-oscillator
  2. StockCharts ChartSchool. "MACD-Histogram." https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-indicators/macd-histogram
  3. CMT Association. "Gerald Appel." https://cmtassociation.org/presenter/gerald-appel/
  4. Appel, G. and Appel, M. "A Quick Tutorial in MACD: Basic Concepts." https://www.stockmarkettheory.com/uploads/3/4/8/2/34825752/macd_tutorial.pdf

Disclaimer

This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.

Back to your knowledge path

The IWP Substack

You understand the concept. Now see it applied.

The Investing With Purpose Substack turns ideas like this into research and risk-managed trade plans on real stocks, updated every week.

Read on Substack (opens in a new tab)

Related concepts