TradingMaths

Home › Learn › MACD indicator explained

MACD indicator explained

Updated 11 October 2026

MACD stands for Moving Average Convergence Divergence. Gerald Appel developed it in the late 1970s. It measures the gap between a fast and a slow exponential moving average, and how that gap is changing.

When the fast average is above the slow one, recent prices are higher than older prices. When the gap widens, that difference is growing. MACD turns this into a line, a signal line and a histogram.

The three parts of MACD

The default settings are written as (12, 26, 9). If you need a refresher on exponential averages, see SMA vs EMA.

How an EMA updates

New EMA = previous EMA + k × (close − previous EMA), where k = 2 ÷ (period + 1).

Worked example

Stock ABC's previous 12-day EMA is ₹1,050 and its previous 26-day EMA is ₹1,036. The previous signal line value is 12. Today it closes at ₹1,063.

  1. 12-day EMA = 1,050 + (2 ÷ 13) × (1,063 − 1,050) = 1,050 + (2 ÷ 13) × 13 = 1,050 + 2 = ₹1,052
  2. 26-day EMA = 1,036 + (2 ÷ 27) × (1,063 − 1,036) = 1,036 + (2 ÷ 27) × 27 = 1,036 + 2 = ₹1,038
  3. MACD line = 1,052 − 1,038 = 14
  4. Signal line = 12 + 0.2 × (14 − 12) = 12 + 0.4 = 12.4
  5. Histogram = 14 − 12.4 = 1.6

Both averages rose by ₹2 here, but the 12 EMA closed 2/13 of its gap to price while the 26 EMA closed only 2/27 of its gap: the fast average gives each new close more weight. Here the MACD line is above the signal line, so the histogram is positive. The MACD value is in rupees, so a ₹1,000 stock and a ₹100 stock will show very different MACD sizes for similar percentage moves.

How MACD is commonly read

Zero line

MACD above zero means the 12 EMA is above the 26 EMA. Below zero means the reverse. A cross of zero is just the two averages crossing each other.

Signal line crossovers

When the MACD line moves above the signal line, the histogram turns positive; when it moves below, the histogram turns negative. Many people watch these crossovers, but in sideways markets they flip back and forth often, producing a lot of false starts.

Histogram

The histogram shows whether the MACD line is pulling away from or moving toward its own average. Shrinking bars mean the gap between the two EMAs is changing more slowly, not that price will turn.

Divergence

As with RSI, a divergence is when price makes a new high or low but MACD does not. It describes a smaller push than before. Many divergences fade without any reversal.

Settings

(12, 26, 9) came from a time when markets traded six days a week. Some people use shorter settings for intraday charts or longer ones for weekly charts. Changing the numbers only changes how fast or slow the lines react; it does not make MACD more accurate.

Limits you should know

The risk side

MACD crossovers are a common entry trigger in F&O, where losses are widespread. SEBI's studies (SEBI study, 2023 and 2025) found about 9 in 10 individual F&O traders lost money in FY22 and FY25. Before any trade, plan your stop-loss, check the risk-reward, and remember that brokerage, STT and other charges come out of every trade, win or lose.

Quick recap

Questions people ask

What does a MACD crossover mean?
It means the MACD line has moved above or below its 9-period average, so the histogram changes sign. It describes a change in recent momentum, not a guaranteed turn in price.
Is MACD better than RSI?
Neither is better. MACD measures the gap between two moving averages in price units, while RSI measures the balance of gains and losses on a 0 to 100 scale. Both lag.
Can MACD be negative?
Yes. MACD is negative whenever the 12-period EMA is below the 26-period EMA, which happens after prices have been falling.
Why do MACD values differ between stocks?
MACD is measured in rupees, so higher-priced stocks naturally show larger MACD numbers. Compare a stock's MACD with its own history, not with another stock.

Sources

Related