Moving Average Convergence Divergence MACD
Two moving averages turned into a momentum oscillator with a signal line and histogram.
Quick answer: MACD is a trend-following momentum indicator that plots the difference between a fast and a slow EMA, with a signal line and a histogram, to reveal shifts in trend strength and direction.
In simple words
MACD takes two exponential moving averages — a fast 12-period and a slow 26-period — and subtracts one from the other. When the fast average pulls away above the slow one, momentum is turning up; when it falls below, momentum is turning down. A 9-period signal line smooths the MACD, and the gap between them is drawn as a histogram, so you can see momentum building or fading at a glance. Traders use MACD crossovers, the zero line and the histogram to time entries and gauge trend strength.
Moving Average Convergence Divergence — visual
How Moving Average Convergence Divergence looks on a chart
The MACD line (fast−slow EMA) and its signal line cross to give signals; the histogram shows the gap between them, expanding as momentum builds and shrinking as it fades. Zero marks the trend divide.
Professional explanation
The three parts of MACD
MACD has three components. The MACD line is the 12-EMA minus the 26-EMA. The signal line is a 9-EMA of the MACD line. The histogram is the MACD line minus the signal line. Each answers a different question: the MACD line shows raw momentum, the signal line smooths it to generate crossovers, and the histogram shows the rate at which momentum is accelerating or decelerating.
Three ways to read it
First, signal-line crossovers: MACD crossing above its signal is bullish, below is bearish. Second, the zero line: MACD above zero means the fast EMA is above the slow EMA (an uptrend), below zero a downtrend. Third, divergence: like RSI, MACD diverging from price warns of exhaustion. The histogram is often the earliest tell — it peaks and turns before the crossover happens.
Why it is both trend and momentum
MACD is unusual: it is built from moving averages (a lagging, trend tool) but expressed as an oscillator (a momentum tool). That dual nature is its strength — it keeps you on the right side of the trend via the zero line while timing entries via crossovers. It is also its weakness: because it is EMA-based, it lags, and in a sideways market the crossovers whipsaw.
The histogram as an early warning
Professionals watch the histogram closely. When the histogram bars stop growing and start to shrink, momentum is decelerating even though price may still be rising — an early hint that a crossover is coming. A shrinking histogram into a new price high is the MACD equivalent of bearish divergence and often precedes the actual signal-line cross by several bars.
Formula
Moving Average Convergence Divergence formula
MACD = EMA₁₂(close) − EMA₂₆(close); Signal = EMA₉(MACD); Histogram = MACD − Signal
The classic settings are 12, 26 and 9. All three are exponential moving averages, so recent prices carry more weight.
- EMA₁₂ — 12-period exponential moving average of closing price (the fast line)
- EMA₂₆ — 26-period exponential moving average of closing price (the slow line)
- Signal — 9-period EMA of the MACD line
- Histogram — MACD line minus the signal line
How it is calculated
- Compute the 12-period EMA and the 26-period EMA of closing price.
- Subtract the slow (26) EMA from the fast (12) EMA to get the MACD line.
- Take a 9-period EMA of the MACD line to get the signal line.
- Subtract the signal line from the MACD line to get the histogram.
- Plot the MACD line and signal line together, with the histogram as bars around the zero line.
Interpretation & signals
Traders read MACD three ways: the signal-line crossover (momentum trigger), the zero-line position (trend direction), and divergence plus a shrinking histogram (early reversal warning).
Buy / bullish signals
- MACD line crosses above the signal line (bullish crossover).
- MACD crosses above the zero line, confirming an uptrend.
- Bullish divergence: price makes a lower low while MACD makes a higher low.
- Histogram turns from falling to rising below zero (early momentum shift).
Sell / bearish signals
- MACD line crosses below the signal line (bearish crossover).
- MACD crosses below the zero line, confirming a downtrend.
- Bearish divergence: price makes a higher high while MACD makes a lower high.
- Histogram peaks and starts shrinking above zero (momentum decelerating).
False signals to beware
- In a sideways market, MACD crossovers whipsaw repeatedly around the zero line.
- Crossovers far from zero can be late — the bulk of the move may be over.
- A single crossover without zero-line agreement often fails.
Settings, timeframe & conditions
Advantages & limitations
Advantages
- Combines trend and momentum in one tool.
- The histogram gives an early read on momentum before crossovers.
- Zero line keeps you aligned with the larger trend.
- Clear, objective crossover signals that are easy to automate.
Limitations & disadvantages
- Lags because it is built from moving averages.
- Whipsaws badly in ranging markets.
- Unbounded scale makes overbought/oversold hard to judge.
- Values are not comparable across instruments of different price levels (use PPO for that).
Combining Moving Average Convergence Divergence with other indicators
- Average Directional Index — ADX confirms whether a trend is strong enough to trust MACD crossovers — take crossovers only when ADX is above 20–25.
- Relative Strength Index — RSI and MACD agreeing on a momentum shift is far stronger than either alone; RSI adds the overbought/oversold context MACD lacks.
- Exponential Moving Average — A 200-EMA trend filter keeps you taking only the MACD crossovers that align with the primary trend.
Practical examples (Nifty & Bank Nifty)
NIFTY example
Nifty is trending up above its 50-EMA. It pulls back for a few sessions and the MACD histogram shrinks toward zero, then the MACD line curls up and crosses above its signal line while still above zero. That bullish crossover in the direction of the established uptrend, with MACD above zero, is a textbook continuation entry — momentum re-engaging after a pause.
BANKNIFTY example
Bank Nifty makes a new high at 52,300 but the MACD line prints a lower peak than at the previous high — bearish divergence. The histogram, which had been expanding, starts to contract. A few bars later MACD crosses below its signal line, and the divergence-plus-crossover combination warns that the up-move is running out of steam before price confirms with a lower high.
Common mistakes
- Trading every crossover regardless of the zero line or the larger trend.
- Using MACD in a range, where crossovers whipsaw.
- Ignoring the histogram, which often warns before the crossover.
- Comparing MACD values between a ₹500 stock and Nifty — the scale is price-dependent.
Professional usage
Professionals treat MACD as a trend-momentum filter rather than a standalone system. They favour crossovers that occur on the correct side of the zero line and in the direction of the higher-timeframe trend, and they watch the histogram for early deceleration. In systematic strategies MACD is often one confirming input among several, with ADX or a moving-average filter deciding whether the market is trending enough to act on its signals.
Key takeaway
MACD merges trend and momentum: the zero line tells you the trend, the crossover times the entry, and the histogram warns when momentum is fading. It shines in trends and whipsaws in ranges — so pair it with a trend-strength filter.
Frequently asked questions
What is the MACD indicator?
What are the best MACD settings?
What is a MACD crossover?
What does the MACD histogram show?
Is MACD a leading or lagging indicator?
What does the MACD zero line mean?
What is MACD divergence?
Which is better, MACD or RSI?
Does MACD work for intraday trading?
Why does MACD whipsaw?
Voice search & related questions
Natural-language questions people ask about Moving Average Convergence Divergence.
What is MACD in simple terms?
Is a MACD crossover a buy signal?
What is the best timeframe for MACD?
What do the MACD bars mean?
Sources & references
Last reviewed 8 July 2026. Educational content only — not investment advice.