Technical Analysis

What is MACD?

Reviewed by Karthikeyan Anbarasan (Founder, TradeLyser) · Updated 19 Oct 2026 · Editorial policy

DefinitionMACD (Moving Average Convergence Divergence) is a momentum indicator equal to the 12-period EMA minus the 26-period EMA, plotted with a 9-period EMA of itself as the signal line and the gap between them as a histogram. If an illustrative Nifty 12-day EMA is 25,140 and the 26-day EMA is 25,080, the MACD line is +60 points.
Formula
MACD line = EMA(12) − EMA(26); Signal = EMA(9) of the MACD line; Histogram = MACD line − Signal
Example
MACD = 25,140 − 25,080 = +60; with a signal of 45, histogram = 60 − 45 = +15 (illustrative Nifty daily)

How MACD is calculated

Formula
MACD line = EMA(12) − EMA(26) · Signal line = EMA(9) of MACD · Histogram = MACD − Signal
Example
Illustrative Nifty daily: 25,140 − 25,080 = +60; signal 45; histogram +15

Each EMA uses a smoothing factor of 2 ÷ (n + 1): about 0.154 for 12 periods, 0.074 for 26 and 0.2 for the 9-period signal. When the fast EMA pulls away from the slow one, the MACD line moves away from zero; when they converge, it moves back towards zero. The histogram shows whether that gap is widening or narrowing, which is why it turns before the MACD line crosses its signal.

12, 26 and 9 are Gerald Appel’s original settings and the default almost everywhere. Some traders shorten them for intraday charts, but the defaults are what most published examples assume. MACD is measured in price points, so a reading of +60 on Nifty and +250 on Bank Nifty say nothing about which is stronger. The percentage price oscillator, (EMA12 − EMA26) ÷ EMA26 × 100, puts both on the same scale: 60 ÷ 25,080 is about 0.24%.

Worked example: momentum fading under a rising price

DayNifty closeMACDSignalHistogram
125,05072.050.0+22.0
225,11076.055.2+20.8
325,16074.059.0+15.0
425,19069.061.0+8.0
525,21063.061.4+1.6
625,18058.060.7−2.7

Illustrative. Each signal value is the previous signal plus 0.2 × (MACD − previous signal); for day 2, 50 + 0.2 × 26 = 55.2. Nifty closes higher on days 2 to 5, but the histogram shrinks from day 2 and the MACD line peaks on day 2. On day 6 the MACD line crosses below the signal and the histogram turns negative. MACD is still well above zero, so the 12-day EMA remains above the 26-day: the trend is up, but its pace has slowed.

MACD peak (day 2)
76.0
Histogram on day 5
+1.6
Histogram on day 6
−2.7
MACD vs zero on day 6
Still +58

How traders use MACD

Signal-line cross

MACD crossing above the signal is read as bullish, below as bearish. The fastest of the signals and the noisiest.
Example: day 6 above

Zero-line cross

MACD crossing zero means the 12 EMA has crossed the 26 EMA. Slower, used as a trend filter.
Trend read

Divergence

Price makes a higher high while MACD makes a lower high, or the reverse. A warning that momentum is fading, not a timing signal.
Days 2 to 5 above
  1. Decide which MACD signal your setup uses and on which timeframe; write it as one rule.
  2. At entry, log MACD above or below zero and whether the histogram is rising or falling.
  3. Tag trades where MACD agreed with the daily trend and where it did not.
  4. After 30 or more trades per tag, compare expectancy; drop the signal if it does not separate results.

Limits and common mistakes

MACD is built from moving averages, so it lags price: a cross often comes after a good part of the move has happened. In sideways markets the line hugs zero and crosses repeatedly. Divergences can persist through long trends, with momentum readings fading while price keeps rising. Treat MACD as a description of trend pace that supports a setup you already have, not as a standalone buy and sell rule.

Two mistakes recur in reviews. One is changing settings to fit recent trades, for example 8, 21, 5 after a week of late signals; the next week tends to need different numbers again. The other is stacking MACD with RSI and stochastic, which are all built from the same price series and tend to agree, so three confirmations add little that one did not already show.

For Indian traders
Nifty often gaps at the 9:15 open, and a large gap moves the 12-period EMA about twice as much as the 26, so MACD can jump on the first bar of the session on both daily and intraday charts. If you trade Nifty options, remember that option premiums also move on time decay and volatility, so a MACD signal on the index does not translate one-to-one into option P&L. Nifty weekly options expire on Tuesday.

Reference guide

ContextValueReading
MACD signal taken in the direction of the higher-timeframe trendFilteredCrosses with the trend are easier to manage than crosses against it; tag both and compare
Every signal-line cross traded in a sideways marketWhipsawMACD crosses back and forth around zero in ranges; each cross pays charges
MACD value compared across instrumentsWrong scaleMACD is in points, so Bank Nifty’s is larger than Nifty’s; use PPO to compare

Questions

What are the standard MACD settings?

12, 26 and 9: a 12-period EMA minus a 26-period EMA, with a 9-period EMA of that difference as the signal line. They are the default on most platforms.

How is MACD calculated?

Subtract the 26-period EMA from the 12-period EMA to get the MACD line, take a 9-period EMA of it for the signal line, and subtract the signal from MACD for the histogram.

What does the MACD histogram show?

The gap between the MACD line and its signal line. A shrinking histogram means momentum is slowing even if price is still moving in the same direction.

Is MACD good for intraday trading?

It is used on 5- and 15-minute charts, but it lags and whipsaws in ranges. Many intraday traders use it as a trend filter alongside price levels and VWAP rather than as the trigger.

What is a MACD divergence?

When price makes a new high or low that MACD does not confirm. It shows fading momentum and can last a long time before price turns, so it is usually combined with a price trigger.

Related terms