Learn › Indicators

MACD Explained: Lines, Histogram, Crossovers and Common Mistakes

The Moving Average Convergence Divergence indicator, developed by Gerald Appel in the late 1970s, measures the gap between two exponential moving averages and how that gap is changing. It is popular because one panel shows both trend direction and momentum. It is also frequently misused, mostly because traders forget that every component of MACD is a moving average and therefore lags price. This guide walks through each part of the indicator and the practical consequences of how it is built.

The three components

With the standard settings of 12, 26 and 9:

  • MACD line = EMA(12) of the close − EMA(26) of the close.
  • Signal line = EMA(9) of the MACD line.
  • Histogram = MACD line − signal line.

An exponential moving average gives more weight to recent prices. Its smoothing factor is α = 2 / (n + 1), so the 12-period EMA uses α ≈ 0.154 and the 26-period EMA uses α ≈ 0.074. Because the faster average reacts more to new prices, the MACD line becomes positive when recent prices are rising faster than the longer-term average and negative when they are falling.

Reading the MACD line

The MACD line is in price units. A value of +15 on an index trading at 22,000 means the 12-period EMA is 15 points above the 26-period EMA. That has two consequences:

  • You cannot compare MACD values between instruments with different prices. Some traders normalise it by dividing by price (sometimes called a percentage price oscillator).
  • The same instrument's MACD values grow when its price and volatility grow, so fixed thresholds such as “MACD above 10” stop meaning the same thing over time.

The sign of the MACD line is the simplest information it provides. Above zero, the faster average is above the slower one — a short-term uptrend relative to the medium term. Below zero, the reverse.

Signal-line crossovers

The most common MACD signal is the MACD line crossing above its signal line (bullish) or below it (bearish). Equivalently, the histogram changes sign. Because the signal line is an average of the MACD line, a crossover says that the gap between the two EMAs has started to widen or narrow faster than it did recently. In other words, it is a change in momentum of a momentum measure.

In trending markets, signal-line crossovers in the direction of the trend can be useful entry triggers. In choppy markets, the lines cross back and forth often, and each crossover costs fees and spread. A common filter is to accept bullish crossovers only when the MACD line is above zero, or only when a longer-term trend condition holds.

Zero-line crossovers

When the MACD line crosses zero, the 12- and 26-period EMAs have crossed each other. This is simply a moving-average crossover expressed differently, and it signals later than a signal-line crossover. It produces fewer but slower signals and is often used as a trend filter rather than an entry trigger.

The histogram

The histogram shows the distance between the MACD and signal lines. A shrinking histogram means momentum is fading even if the MACD line is still rising. Traders sometimes act on the first bar where the histogram shrinks after a long expansion, trying to anticipate a crossover. That gives earlier signals at the cost of more false ones — a trade-off that must be tested rather than assumed.

Worked example of lag

Imagine a market that has been flat at 100 and then rises by 1 per bar for 10 bars. The 12-period EMA starts moving immediately but only moves about 15% of the way toward each new price; the 26-period EMA moves about 7% of the way. After a few bars the MACD line turns positive, and the signal line follows a few bars later. By the time the signal-line crossover occurs, price may already have moved several bars' worth. If the rise then stops, the indicator will take several more bars to turn down. This is not a flaw that settings can remove: any average reacts after the data it averages.

Divergence

As with RSI, a bearish divergence is a higher high in price with a lower high in the MACD line or histogram. Because MACD is in price units and depends on volatility, divergences are particularly common after a sharp move followed by a slower continuation. Treat divergence as context rather than a trade signal, and define it precisely if you want to test it.

Settings

The 12/26/9 defaults were chosen in an era of daily charts and a six-day trading week. There is nothing special about them for crypto markets that trade 24/7 or for intraday charts. Faster settings such as 8/17/9 react sooner but give more false signals; slower settings reduce noise and add lag. If you optimise the three parameters together, be careful: three free parameters on a small sample is an easy route to an overfitted result. Prefer testing a few sensible combinations on one period and confirming the choice on a later period it was not tuned on.

A testable MACD rule set

  • Trend filter: close above the 200-period EMA for longs, below it for shorts.
  • Entry: MACD line crosses its signal line in the trend direction, with the MACD line on the same side of zero.
  • Stop: a multiple of ATR from entry, so the stop scales with volatility.
  • Exit: the opposite crossover, a profit target, or a trailing stop.

Evaluate the rules on closed bars only, include realistic fees and slippage, and compare the result with the plain trend filter on its own. If MACD does not improve on the simpler rule, the extra complexity is not earning its place.

Common mistakes

  • Comparing MACD values across instruments or across years without normalising.
  • Acting on crossovers within a bar that has not closed yet; the lines can cross and uncross before the close.
  • Expecting MACD to call tops and bottoms. It is a lagging trend-and-momentum measure.
  • Optimising all three periods aggressively on a short history.

Key takeaways

  • MACD line = EMA(12) − EMA(26); signal = EMA(9) of the MACD line; histogram = the difference.
  • Crossovers are momentum changes and lag price; filters reduce whipsaws in sideways markets.
  • MACD is in price units, so thresholds and comparisons need normalising.
  • Test a small set of settings and confirm them on later data before trusting them.

Educational content only. This guide explains general concepts and is not investment advice or a recommendation to trade any instrument. Trading involves substantial risk of loss, and historical or simulated results do not guarantee future performance. Read the Risk Disclosure.

Related guides