Momentum & oscillatorsMACD · MACD
The difference between two EMAs, with a signal line and histogram — momentum and trend in one.
Works best in trending marketsEngine-computed on a fixed sample series
What it is
The MACD, short for Moving Average Convergence Divergence, is one of the most widely used indicators in all of technical analysis, created by Gerald Appel in the late 1970s. It packs both trend and momentum into a single display by measuring the relationship between two exponential moving averages of price. When a fast average pulls away from a slow one, momentum is building in that direction, and when they drift back together, momentum is fading, which is exactly what the words convergence and divergence in its name describe. The tool presents this as a MACD line, a signal line, and a histogram, giving several complementary readings at once. For a beginner, the MACD answers a practical question: is the market's momentum shifting, and in which direction, right now?
How it is calculated
The MACD line is computed by subtracting the twenty-six period exponential moving average of price from the twelve-period exponential moving average, so it rises when the faster average climbs above the slower one and falls when it drops below. A nine-period exponential moving average of the MACD line is then plotted on top as the signal line, acting as a smoothed trigger. The histogram is the difference between the MACD line and the signal line, drawn as bars that grow and shrink around zero, visually capturing how fast the two lines are separating or converging. The standard settings are therefore twelve, twenty-six, and nine, though these are adjustable. Importantly, the MACD is calculated in the price's own units and is unbounded, so it has no fixed overbought or oversold ceiling.
Reading it, step by step
There are three layers to read. First, the signal-line crossover: when the MACD line crosses above its signal line, momentum is shifting bullish, and when it crosses below, bearish. Second, the zero line: when the MACD line is above zero, the twelve-period EMA is above the twenty-six, so the medium-term trend is up, and below zero it is down, which makes zero-line crosses a slower but more meaningful trend signal than the signal-line crosses. Third, the histogram: its bars peak and trough before the crossover actually happens, so a shrinking histogram warns that momentum is decelerating even while price still rises, giving an early read. The most prized signal of all is divergence, where price makes a new high but the MACD makes a lower high, revealing that the momentum behind the move is quietly weakening.
Best timeframes and settings
The default twelve, twenty-six, nine works across timeframes and is the near-universal standard, suiting swing traders on daily charts and day traders on intraday charts alike. Faster settings, such as shorter EMAs, make the MACD react sooner and generate more signals at the cost of more whipsaws, while slower settings produce fewer, more reliable crossovers with more lag. The indicator is genuinely timeframe-agnostic because it is a relationship between two averages, so the same reading logic applies whether the bars are five minutes or one month. Many traders keep the defaults and instead adjust which timeframe they apply the MACD to, using a higher timeframe for the trend and a lower one for timing. As with any moving-average tool, the core trade-off is responsiveness against reliability.
When and where to use it
The MACD is at its best in trending markets, where its crossovers and zero-line signals ride sustained directional moves and its divergences flag exhaustion. It works across all liquid asset classes, from stocks and futures to forex and crypto, wherever price trends cleanly enough. Its main weakness is the choppy, sideways market, where the two averages cross back and forth constantly and the MACD produces a stream of false signals. Because it is calculated in price units and scales with the instrument, you cannot compare the raw MACD value of one stock to another, and for that cross-instrument comparison the percentage-based PPO is the right tool. Use the MACD when a market is trending and lean on other tools when it is ranging.
Strategies that use it
The classic strategy trades signal-line crossovers in the direction of the larger trend, going long when the MACD crosses above its signal line while a higher-timeframe trend is up, and exiting on the opposite cross. A zero-line strategy is slower and more conservative, entering only when the MACD crosses above zero to confirm the medium-term trend has turned, which filters out much counter-trend noise. A divergence strategy is the most anticipatory: when price prints a higher high but the MACD histogram or line makes a lower high, a trader tightens stops or prepares a counter-trend entry, expecting the weakening momentum to resolve into a reversal. Many traders combine these, using zero-line position for bias, crossovers for entries, and divergence for early warnings and exits.
Combining it with other indicators
The MACD pairs naturally with a trend filter such as a two-hundred period moving average, which tells you which direction to trade the crossovers so you avoid fighting the larger trend. A momentum oscillator like the RSI complements it by flagging overbought and oversold extremes that the unbounded MACD cannot show. Volume tools confirm that a bullish crossover is backed by participation. Support and resistance levels give MACD divergences a place to matter, since a bearish divergence at major resistance is far stronger than one in open space. Because the MACD scales with price, the percentage price oscillator is a close cousin used when comparing momentum across different instruments. The theme is to add a trend filter and a bounded oscillator so the MACD's signals are confirmed for both direction and extremity.
Where it fails
The MACD's defining flaw is that it lags and is unbounded, so in choppy, sideways markets it produces frequent false crossovers as the two averages tangle, chopping mechanical traders in and out for losses. Because it scales with price, its raw values cannot be compared across different stocks, a trap for those who try. It is a trend tool wearing the costume of an oscillator, so treating it as an overbought or oversold gauge fails, since it has no fixed extremes. Divergence signals, while powerful, can persist for a long time in a strong trend before resolving, so acting on them too early means fighting a trend that is not done. The defenses are to trade the MACD only with a trend filter, to avoid it or demand extra confirmation in ranges, and to treat divergence as a warning rather than an immediate reversal trigger.
A worked example
A stock trades above its rising two-hundred day moving average, confirming an uptrend, so you look only for long signals from the MACD set at the default twelve, twenty-six, nine. Price pulls back and the MACD line, which had dipped toward zero, crosses back above its signal line while remaining above the zero line, a bullish momentum shift within an uptrend. You enter long at eighty-four with a stop at eighty-one below the recent swing low, risking three dollars. As price advances the histogram expands, confirming accelerating momentum, and you hold toward ninety-two. Near ninety-three the stock makes a marginal new high but the MACD histogram prints a clearly lower peak, a bearish divergence warning that momentum is fading, so you tighten your stop and exit at ninety-one when the MACD finally crosses back below its signal line, capturing the bulk of the move.