What is the MACD indicator?

MACD stands for moving average convergence divergence. Gerald Appel created it in the late 1970s, and Thomas Aspray added the histogram in 1986. It sits in its own panel under the price chart and turns two moving averages into one line that answers two questions at a glance: which way is price moving away from its recent average, and is that push speeding up or slowing down?

The name describes what the two averages do. When the fast average pulls away from the slow one, they diverge and momentum is building. When it drifts back toward the slow one, they converge and momentum is fading. MACD is a trend-following momentum indicator: it describes the move already under way and does not predict the next one. It belongs next to levels, trend and candles in any technical analysis for beginners toolkit, not in place of them.

How is MACD calculated? The three parts

MACD is built from exponential moving averages (EMAs) of the closing price. An EMA gives the newest close a weight of 2 ÷ (length + 1): about 15.4% for a 12 EMA and about 7.4% for a 26 EMA. The 12 EMA hugs price, the 26 EMA trails it, and MACD measures the distance between them. Our EMA trading strategy guide covers EMAs on their own.

A hypothetical example: the 12 EMA is at $100.60 and the 26 EMA at $100.20, so the MACD line reads +0.40. The fast average is 40 cents above the slow one. The signal line is at +0.25, so the histogram is +0.15. One bar later the MACD line slips to +0.36 and the signal line rises to about +0.27, so the histogram shrinks to about +0.09. MACD is still above its signal line, but the gap is closing.

The drawing below shows the two-line idea with a 9 and a 20 EMA. MACD does the same with a 12 and a 26 EMA, then plots the gap between the lines instead of the lines themselves.

MACD line
The 12-period EMA minus the 26-period EMA of the close. Above zero, the fast average is above the slow one; below zero, it is under it.
Signal line
A 9-period EMA of the MACD line. It is smoother and slower, so the MACD line crossing it marks a change in short-term momentum.
MACD histogram
The MACD line minus the signal line, drawn as bars. Bars above zero mean MACD is above its signal line; growing bars mean the gap is widening.
Zero line
The level where the 12 and 26 EMAs are equal. MACD crossing zero is the same event as the 12 EMA crossing the 26 EMA.

Turn your phone sideways to read the drawing. Tap to close.

An uptrend with a fast EMA (solid line, labeled EMA 9) and a slower EMA (dashed line, labeled EMA 20); price pulls back to the fast EMA, holds it and prints a buy signal.

How to read MACD: crossovers and the zero line

A MACD crossover is the MACD line crossing its signal line. A bullish crossover, MACD crossing above the signal line, says short-term upside momentum is picking up or downside momentum is easing. A bearish crossover is the reverse. It is the most watched MACD signal and the most overtraded one.

Where the crossover happens matters. A bullish crossover below the zero line comes while the 12 EMA is still under the 26 EMA: it is an early sign that a decline is slowing, often against the larger trend. A bullish crossover above zero comes inside an existing uptrend, often at the end of a pullback, so it points with the trend rather than against it.

A zero-line cross is the MACD line itself crossing zero, which is simply the 12 EMA crossing the 26 EMA. It comes later than a signal-line crossover and flips less often, so many traders use it as a bias filter: above zero, favor longs; below zero, favor shorts or stand aside. Crossovers far from zero, after a long run, deserve the most caution, because the move behind them may already be stretched.

  • Bullish crossover: the MACD line crosses above the signal line. Momentum is turning up.
  • Bearish crossover: the MACD line crosses below the signal line. Momentum is turning down.
  • Zero-line cross up: the 12 EMA moves above the 26 EMA. The short-term trend has turned up.
  • Zero-line cross down: the 12 EMA moves below the 26 EMA. The short-term trend has turned down.

What does the MACD histogram tell you?

The histogram is the gap between the MACD line and the signal line, drawn as bars. Aspray added it to see crossovers coming: before the two lines can cross, the gap between them has to shrink, and the histogram shows that shrinking bar by bar. When the bars flip from red below zero to green above it, as in the drawing at the top, the lines have crossed.

Read it in three steps. Growing bars mean momentum is accelerating in that direction. Shrinking bars mean it is slowing, not reversing: a stock can keep falling while the red bars get shorter. A flip through zero is the crossover itself. After a turn from a decline to a rise, the order is usually the same: the red bars shrink first, then the lines cross, and the MACD line crosses zero last.

That makes shrinking bars a warning, not a trigger. In the example above, the histogram fell from +0.15 to +0.09 while MACD stayed above its signal line, so the push was slowing. If you are already long, that is a reason to watch your stop and target more closely; it is not a reason to go short.

MACD divergence, briefly

A bullish MACD divergence is price making a lower low while the MACD line or the histogram makes a higher low. A bearish divergence is a higher high in price with a lower high on MACD. It says the move is losing momentum. It does not say the move is over: in a strong trend MACD can diverge again and again while price keeps going.

Divergence is drawn the same way on MACD as on RSI: compare confirmed swing lows with swing lows, or highs with highs, take it only at a real level, and wait for a candle to close your way. The full method, including hidden divergence, is in our RSI divergence guide; for the RSI itself, read our guide to the RSI indicator.

Why MACD lags and whipsaws in ranges

MACD lags because every part of it averages the past. The MACD line is the difference between two averages, and the signal line is an average of that difference, so a crossover is an average of averages. By the time it prints, price has usually turned already. That lag is the cost of a smooth line, and no setting removes it.

In a range it gets worse. When price moves sideways, the 12 and 26 EMAs flatten and wind around each other, MACD hugs the zero line, and the two lines cross every few bars. Take a hypothetical stock chopping between $48.00 and $49.00 on a 15-minute chart. A bullish crossover fires at $48.80, near the top of the range, and the bearish one comes at $48.30: $0.50 lost. The next buy cross comes at $48.70 and the next sell at $48.35, another $0.35. Price went nowhere, and following the crossovers cost $0.85 a share.

The warning is on the indicator itself: tiny histogram bars and a MACD line pinned near zero mean there is little momentum to read. Leave crossovers alone there, or trade the edges of the range as support and resistance instead. Narrow Bollinger Bands show the same quiet market from another angle.

How to trade MACD with levels and the trend

MACD works best as the last check, not the first. Start with the trend on a higher timeframe, then find a level where a trade makes sense, then wait for a closed candle that reacts at that level. MACD only confirms that momentum is turning the way you want to trade. Our multi-timeframe analysis guide covers the first step.

A hypothetical long: on the 1-hour chart, the stock is above a rising 50 EMA. On the 5-minute chart it climbs to a swing high of $102.00, then pulls back into a support zone from $100.00 to $100.30, yesterday's high. On the way down, MACD drops below its signal line and the histogram turns red. In the zone the red bars shrink. Then a candle closes at $100.60, back up off the zone, and on that bar MACD crosses above its signal line, still below zero.

You buy at the next open, about $100.60, with a stop at $99.90 under the zone: $0.70 of risk per share. The target is the $102.00 swing high, $1.40 away, which is 2R. Risking $70 on the trade means 100 shares. The risk-reward ratio guide and the position size calculator show the math.

Now the failed version, which happens often. Two candles later the stock stalls, and a candle closes at $99.85, below the zone. Your stop at $99.90 is hit and you lose about $0.70 a share, roughly $70, the planned 1R (in a fast market a stop can fill a little worse). MACD still showed a bullish crossover when the stop was hit. MACD does not know where your level is; your stop does. And a crossover with no level under it, in the middle of the day's range, you simply skip.

Run the checklist below before any MACD trade. MACD is not on it: it can confirm these checks, never replace them. UpTickFlow, our invite-only TradingView indicator, does not read MACD or any crossover. It handles the steps that come first: it waits for a candle to close at a level, draws the entry, stop and target before the trade, scores the setup from 0 to 100 and stays quiet in chop. Use it as a second check that a level is worth trading, and keep MACD as your momentum read if you like it.

Turn your phone sideways to read the drawing. Tap to close.

A hand-written pre-trade checklist: higher timeframe agrees, price is at a level, the candle has closed, stop and target are set, size = 1% risk.

What are the best MACD settings for day trading?

The default MACD settings are 12, 26 and 9: a 12-period fast EMA, a 26-period slow EMA and a 9-period signal line. They are the defaults on TradingView and the settings most traders use, which is reason enough to start there.

On intraday charts the same numbers cover very different spans of time. On a 5-minute chart, 26 bars is 130 minutes. On a 15-minute chart it is 390 minutes, exactly one regular session from 9:30 a.m. to 4:00 p.m. ET. On a 1-hour chart it is roughly four sessions. So 12, 26, 9 reads the last couple of hours on a 5-minute chart and the last day on a 15-minute chart.

Shorter lengths make MACD turn sooner and cross more often: earlier signals, and more false ones. Longer lengths give fewer, later signals. No setting escapes that trade-off; you only choose where the lag sits. If MACD on a 5-minute chart is too noisy, many traders keep 12, 26, 9 and read it on the 15-minute chart instead. Tripling the numbers to 36, 78 and 27 on the 5-minute chart gives a rough equivalent.

Whatever you pick, keep it fixed. Tuning the numbers until past signals look perfect fits the indicator to old data, and that fit rarely holds on the next chart. On 1-minute charts MACD gets very noisy, so scalpers lean on levels even more. For the rest of your chart setup, see the best TradingView settings.

How to add MACD in TradingView

MACD is built into TradingView and free on every plan. It opens in its own panel under the price chart.

  1. Click Indicators in the top toolbar (or press /), type MACD and pick the built-in Moving Average Convergence Divergence by TradingView.
  2. Open its settings with the gear icon next to its name. On the Inputs tab the defaults are Fast Length 12, Slow Length 26, Source close and Signal Smoothing 9.
  3. Leave Oscillator MA Type and Signal Line MA Type on EMA. Switching them to SMA gives a different line that will not match what most traders see.
  4. To read a higher timeframe's MACD on your chart, set Timeframe, for example to 15 minutes, and keep Wait for timeframe closes ticked so the values only update when each higher-timeframe bar closes.
  5. On the Style tab, change the colors of the MACD line, the signal line and the histogram if you like. For crossover alerts, follow our TradingView alerts guide and pick Once per bar close, so a cross that appears mid-bar and vanishes before the close does not fire.

Common MACD mistakes

Most MACD losses come from asking it to do a job it was never built for:

  • Taking every crossover. Crossovers happen constantly; only the ones at a level and with the trend are worth a look.
  • Reading it like RSI. MACD has no fixed ceiling or floor, so there is no overbought or oversold number. A very high MACD only says price is far above its recent average.
  • Comparing MACD values between stocks. The values are in price units, so +2.00 on a $500 stock and +0.20 on a $50 stock can describe the same percentage move.
  • Fighting the zero line. A bullish crossover far below zero is a bet against the trend; give it less weight, or wait for MACD to work back toward zero.
  • Acting before the candle closes. On the open bar MACD moves with every tick, so a cross can appear and vanish before the close. Judge closed bars only; our TradingView repainting guide explains why.
  • Stacking momentum indicators. MACD, RSI and Stochastic measure much the same thing, so three of them agreeing is closer to one opinion than three. Our list of the best TradingView indicators mixes categories instead.
  • Trading crossovers in the first minutes after the 9:30 a.m. ET open, when the EMAs still mostly reflect yesterday's prices, or in the midday lull, when thin volume makes crossovers less reliable.
  • Using the crossover as the stop. Put the stop where the trade idea is wrong, usually past the level, as in our guide to stop loss and take profit.