NEWAI Portfolio Risk Engine is live for stress testing and hedge planningExplore engine →
📊 TECHNICAL

MACD — Moving Average Convergence Divergence

A trend-following momentum indicator showing the relationship between two exponential moving averages. Includes signal line and histogram for crossover signals.

G
Gerald Appel
Strategy Author
Updated 24 Jun 2026
1.9MUses
14280Likes
0Comments
📊 Open on Chart
Live Demo — MACD — Moving Average Convergence Divergence applied to NIFTY 50 (illustrative)
MACD(12,26,9)
MACD LineSignal LineHistogram (pos)Histogram (neg)

What is MACD?

The MACD (Moving Average Convergence Divergence) was developed by Gerald Appel in the late 1970s. It shows the relationship between two EMAs of price — a fast one and a slow one — and generates trend direction, momentum, and reversal signals.

Components

  • MACD Line: Fast EMA (12) minus Slow EMA (26)
  • Signal Line: 9-period EMA of the MACD line
  • Histogram: MACD Line minus Signal Line (visualizes divergence between the two)

Formula

MACD Line   = EMA(12) – EMA(26)
Signal Line = EMA(9) of MACD Line
Histogram   = MACD Line – Signal Line

Parameters

ParameterDefaultDescription
Fast EMA12Short-term trend
Slow EMA26Long-term trend
Signal9Smoothing of MACD line
SourceClosePrice input

Signal Interpretation

  • Bullish crossover → MACD line crosses above Signal line → buy signal
  • Bearish crossover → MACD line crosses below Signal line → sell signal
  • Zero-line cross → MACD crosses above 0 = bullish; below 0 = bearish
  • Histogram expansion → Momentum accelerating in the current direction
  • Histogram contraction → Momentum fading; possible reversal ahead
  • Divergence → Price makes new high but MACD histogram falls → bearish divergence

Trading Strategies

  • Classic crossover: Enter long when MACD crosses Signal from below; exit when it crosses from above.
  • Zero-line rejection: MACD pulls back to the zero line and bounces — high-probability continuation trade.
  • Histogram divergence: One of the most reliable reversal signals in technical analysis.

Tips & Best Practices

  • MACD is a lagging indicator — it reacts to price, not predicts it. Use with price action for confirmation.
  • Best on daily and weekly charts for swing trading.
  • Intraday scalpers often use faster settings (5,13,5) or (3,10,16).
  • Avoid trading crossovers in choppy, sideways markets — generates many false signals.