Skip to content

Glossary

MACD Indicator: Meaning, Formula and Settings

MACD (Moving Average Convergence Divergence) is a trend-momentum indicator built from two EMAs: the MACD line is the 12-period EMA minus the 26-period EMA, the signal line is a 9-period EMA of the MACD line, and the histogram is their difference. On TradingLead, add 'MACD' from the chart's Indicators dialog, or use ta.macd in Pine.

Definition

MACD (Moving Average Convergence Divergence), created by Gerald Appel, measures the relationship between a fast and a slow exponential moving average. When the two averages move apart (diverge), momentum is strengthening; when they come together (converge), it is fading. MACD is shown in its own pane below the price chart.

Formula

With the standard settings (12, 26, 9):

  1. MACD line = EMA(12) of close − EMA(26) of close
  2. Signal line = EMA(9) of the MACD line
  3. Histogram = MACD line − Signal line

Example: if the 12 EMA is 1,010 and the 26 EMA is 1,000, the MACD line is +10. If the signal line is 8, the histogram is +2 — the MACD line is above its own average, so momentum is rising.

How traders read it

  • Zero line: MACD above zero means the fast EMA is above the slow EMA (bullish bias); below zero, bearish bias.
  • Signal-line crossovers: MACD crossing above its signal line is read as improving momentum; crossing below as weakening.
  • Histogram: growing bars show accelerating momentum; shrinking bars show it slowing, often before a crossover.
  • Divergence: price making a new high while MACD makes a lower high can warn of fading momentum.

Common settings

SettingStandardVariations
Fast EMA128, 5
Slow EMA2621, 35
Signal EMA95
SourceClose—

Pitfalls

  • Lag: MACD is built from moving averages of moving averages, so signals come after the move has started.
  • Sideways markets: frequent false crossovers around the zero line.
  • Not bounded: unlike RSI, MACD values have no fixed range, so "overbought" levels don't transfer between stocks or timeframes.
  • Warmup: the slow EMA and signal line need enough history; the earliest values are less reliable.

How to add MACD on TradingLead

  1. Open a chart at tradinglead.in/charts.
  2. Click Indicators, search MACD and click it.
  3. Open its settings to change the fast, slow and signal lengths, and the colours of the lines and histogram.

To build a custom version in Indicator Studio — TradingLead supports a documented Pine v5/v6 subset, and its ta.macd uses the same corrected EMA recurrence as ta.ema:

//@version=6
indicator("MACD custom")
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
plot(hist, "Histogram", style=plot.style_histogram)
plot(macdLine, "MACD")
plot(signalLine, "Signal")

Educational content only — not investment advice.

Frequently asked questions

What do the MACD numbers 12, 26, 9 mean?
12 and 26 are the lengths of the fast and slow EMAs used to build the MACD line; 9 is the length of the EMA that forms the signal line.
What does a MACD crossover mean?
When the MACD line crosses above the signal line, short-term momentum is improving relative to the recent average; crossing below suggests weakening momentum. Crossovers lag and can fail in sideways markets.
Is MACD good for intraday trading?
Some intraday traders use it on 5- or 15-minute charts, but it is a lagging indicator and produces more false crossovers on short timeframes. Test any rule before using it.

Last updated: