3.4.6Indicators & Oscillators

Learn MACD crossovers and divergence

3,005 words14 min readdifficulty · medium1 backlinks

Overview

The MACD (Moving Average Convergence Divergence) is a momentum indicator that reveals both trend direction and momentum strength through the relationship between two exponential moving averages. MACD crossovers signal potential entry/exit points, while MACD divergence warns of weakening trends before price reversals occur.

The MACD Components

Derivation from First Principles

The MACD system consists of three elements derived from price:

WHY this formula?

  • We subtract the slow (26-period) from fast (12-period) EMA to measure the gap between short-term and long-term momentum
  • When short-term momentum exceeds long-term, the gap is positive (bullish)
  • When short-term lags, the gap is negative (bearish)

HOW EMA works: EMAt=Pt×α+EMAt1×(1α)\text{EMA}_t = P_t \times \alpha + \text{EMA}_{t-1} \times (1 - \alpha) where α=2n+1\alpha = \frac{2}{n+1} (smoothing factor), nn is the period, PtP_t is current price.

For12-period: α12=2130.1538\alpha_{12} = \frac{2}{13} \approx 0.1538
For 26-period: α26=2270.0741\alpha_{26} = \frac{2}{27} \approx 0.0741

WHY exponential weighting? Recent prices matter more for momentum—yesterday's move is more relevant than last month's.

WHY take another EMA? The Signal Line smooths the MACD, creating a baseline. Crossovers between MACD and Signal generate trading signals.

WHAT it shows: The distance between MACD and Signal. Growing histogram = accelerating momentum. Shrinking histogram = decelerating momentum.

Figure — Learn MACD crossovers and divergence

MACD Crossovers

Bullish Crossover (Golden Cross)

HOW to identify:

  1. MACD Line was below Signal Line (histogram negative)
  2. MACD Line crosses upward through Signal Line
  3. Histogram transitions from negative to positive
  4. Preferably occurs in or near zero line (stronger signal)

Day 6: Price rallies to ₹105

  • EMA12\text{EMA}_{12} rises faster than EMA26\text{EMA}_{26} due to lower α value capturing recent surge
  • MACD Line = 51.5 - 52.0 = -0.5 (still negative but rising)

Day 7: Price ₹107

  • EMA12\text{EMA}_{12} = 52.8, EMA26\text{EMA}_{26} = 52.3
  • MACD = +0.5 (crossed zero line)
  • Signal still at -0.2 (slower to respond)
  • Histogram = 0.5 - (-0.2) = +0.7

Day 8: Price ₹108

  • MACD = +0.9, Signal = +0.1
  • CROSSOVER OCCURS: MACD crosses above Signal
  • Histogram = +0.8 (positive and growing)

Why this step-by-step matters: The crossover confirms the trend change after momentum shifted. You're not catching the bottom but confirming the reversal.

Bearish Crossover (Death Cross)

HOW to identify:

  1. MACD Line was above Signal Line (histogram positive)
  2. MACD Line crosses downward through Signal Line
  3. Histogram transitions from positive to negative
  4. Crossing below zero line adds conviction

Day 1 decline: Price drops to ₹147

  • Short-term EMA falls faster
  • MACD = +1.8, Signal = +1.6 (Signal catches up slower)
  • Histogram shrinks to +0.2

Day 2: Price ₹145

  • MACD = +1.5, Signal = +1.6
  • CROSSOVER: MACD crosses below Signal
  • Histogram = -0.1 (negative)

Day 3: Price ₹142

  • MACD = +0.8, Signal = +1.3
  • Histogram = -0.5 (widening, confirming bearish momentum)

Why this matters: The bearish crossover warned of the trend weakening before the steper decline to ₹142.

Centerline Crossovers

  • MACD crosses above zero: EMA12>EMA26\text{EMA}_{12} > \text{EMA}_{26} → Confirmed uptrend
  • MACD crosses below zero: EMA12<EMA26\text{EMA}_{12} < \text{EMA}_{26} → Confirmed downtrend

MACD Divergence

Regular Bullish Divergence

WHY it predicts reversals:

  • Price driven by late sellers (panic, stop-losses)
  • But underlying momentum (MACD) shows selling pressure weakening
  • Buyers stepping in at higher prices than previous low
  • The gap between appearance (price) and reality (momentum) eventually closes

Rally to Day 10: Price recovers to ₹100, MACD = -0.5

Low 2 (Day 20): Price = ₹88 (lower low), MACD = -1.8 (higher low than -2.5)

Analysis:

  • Price dropped₹2 lower (₹90 → ₹88)
  • But MACD improved by0.7 (from -2.5 to -1.8)
  • WHY? EMA12\text{EMA}_{12} declining slower than before
    • First drop: EMA12\text{EMA}_{12} fell from 92to 87.5 (Δ = 4.5)
    • Second drop: EMA12\text{EMA}_{12} fell from 101 to 98(Δ = 3.0)
  • Sellers exhausted, buyers absorbing supply

Day 25: Price bounces to ₹95, confirming divergence signal

Why each step: We compare the rate of change in momentum vs. price. Price made a marginal new low, but momentum improved significantly—the reversal indicator.

Regular Bearish Divergence

The mechanics:

  • Price pushed by late buyers (FOMO, breakout chasers)
  • Momentum weakening: fewer buyers at each new high
  • The uptrend is "running out of gas"

Dip to Day 10: Price = ₹190, MACD = +1.5

High 2 (Day 20): Price = ₹205 (higher high), MACD = +2.8(lower high than +3.2)

Detailed calculation for Day 20:

  • At High 1: EMA12\text{EMA}_{12} = 202, EMA26\text{EMA}_{26} = 198.8, MACD = 3.2
  • At High 2: EMA12\text{EMA}_{12} = 207, EMA26\text{EMA}_{26} = 204.2, MACD = 2.8
  • WHY lower MACD despite higher price?
    • The 26-period EMA "caught up" more than the 12-period extended
    • Gap narrowing = momentum slowing
    • EMA26\text{EMA}_{26} rose 5.4 points vs. EMA12\text{EMA}_{12} only 5points

Day 25: Price drops to ₹195, confirming divergence

Hidden Divergence

Use case: Identifies buying opportunities in existing uptrends. Not a reversal signal but a continuation signal.

Use case: Identifies shorting opportunities in existing downtrends.

Swing Low1 (Day 40): Price = ₹70, MACD = +1.5 (during pullback)

Swing Low 2 (Day 60): Price = ₹75(higher low), MACD = +0.9 (lower low)

Interpretation:

  • Price held higher low = uptrend structure intact
  • MACD lower = momentum reset (healthy profit-taking)
  • Not a weakening trend, just a breather before next leg up

Day 65: Price resumes to ₹85

Why this works: In strong trends, pullbacks are shallow in price but deeper in momentum (traders book profits). This "reloads" the indicator for the next push.

Trading Strategies

Strategy 1: Signal Line Crossover with Histogram Confirmation

Entry rules:

  1. Wait for MACD to cross Signal Line
  2. Confirm histogram is expanding in the direction of crossover
  3. Volume should increase on crossover day
  4. Preferably near zero line

Exit rules:

  • Opposite crossover OR
  • Histogram starts shrinking (momentum fading)

Why histogram matters: A crossover with flat histogram = weak signal (sideways chop). Growing histogram = strong momentum follow-through.

Strategy 2: Divergence Trading

Setup:

  1. Identify divergence (price vs. MACD mismatch)
  2. Wait for MACD to cross Signal in divergence direction
  3. Enter on crossover confirmation

Risk management:

  • Stop-loss below recent swing low (bullish) or above swing high (bearish)
  • Target = 1.5x to 2x the risk

Strategy 3: Zero Line Rejection

Concept: In strong trends, MACD pulls back to zero line but doesn't cross—it "bounces" off zero.

Bullish setup:

  • Uptrend: MACD above zero
  • MACD dips toward zero but holds (doesn't cross below)
  • MACD turns up from near-zero → BUY THE DIP

Bearish setup:

  • Downtrend: MACD below zero
  • MACD rises toward zero but fails to cross above
  • MACD turns down from near-zero → SHORT THE BOUNCE

Mistake 2: Ignoring histogram Why it feels right: "MACD crossed Signal, that's the signal." The problem: A crossover with shrinking histogram = dying momentum. You're entering as the move exhausts. The fix: Only trade crossovers where histogram is expanding for at least 2 bars after crossover.

Mistake 3: Expecting immediate moves Why it feels right: "I got the signal, price should move NOW." The problem: MACD is a lagging indicator (built on EMAs of past prices). The actual low/high occurred 3-5 days earlier. The fix: Use MACD for confirmation, not prediction. Combine with leading indicators (RSI, price action) for entries.

Mistake 4: Forgetting timeframe context Why it feels right: "Bullish divergence on 5-min chart, let's buy!" The problem: Lower timeframes = more noise, more false signals. A5-min divergence may be irrelevant to daily trend. The fix: Trade MACD on daily/weekly for swing trades. Use intraday only if aligned with higher timeframe trend.

Mistake 5: Divergence without price confirmation Why it feels right: "I see the divergence forming, jump in early!" The problem: Divergence is a warning, not a signal. Price can continue trending for days before reversing. The fix: Wait for MACD crossover + price breaking key level (swing high/low, trendline) before entering.

Crossover rhyme: "MACD goes above? Bulls show love. MACD drops below? Bears steal the show."

Divergence rule: "Price and MACD disagree? Wait for them to agree (crossover) before you act."

Connections

  • 3.4.02-Calculate-moving-averages - MACD built on EMA foundation
  • 3.4.01-Understand-support-and-resistance - Divergence forms at S/R levels
  • 3.4.08-ApplyBollinger-Bands - Combine MACD + Bollinger for mean reversion
  • 3.4.03-Identify-trend-lines - MACD confirms trendline breaks
  • 3.2.04-Recognize-candlestick-patterns - Divergence + engulfing candle = high-probability
  • 3.4.05-Use-RSI-for-momentum - RSI + MACD divergence double confirmation
  • 2.3.02-Assess-stock-volatility - Higher volatility = wider MACD swings
  • 4.1.03-Set-stop-loss-orders - Place stops beyond MACD divergence swing points
Recall Explain to a 12-Year-Old

Imagine you're racing your friend every day. You check how far ahead or behind you are (MACD line) and also keep a notebook of the average gap over the last few days (Signal line). When today's gap is bigger than the average, you know you're speding up—that's a "crossover" and tells you to keep running hard.

Now, here's the weird part: Sometimes the race results (price) say your friend won the last three races, BUT your notebook shows you're actually closing the gap each time (divergence). Even though it looks like you're losing, you're getting faster—and soon you'll win. That's what divergence tells traders: the scoreboard (price) and your actual speed (momentum) don't match, so something's about to change.

The histogram? That's just a quick-glance bar chart showing if the gap is growing (you're pulling away) or shrinking (race is tightening). If the bars get shorter, you're slowing down even if you're still ahead.

#flashcards/stock-market

What are the three components of the MACD system? :: MACD Line (12-EMA minus 26-EMA), Signal Line (9-EMA of MACD), and Histogram (MACD minus Signal).

What does a bullish MACD crossover signal?
MACD line crosses above the Signal line, suggesting upward momentum is building—potential buy signal.
What is regular bullish divergence?
Price makes lower lows while MACD makes higher lows, warning that downward momentum is weakening despite falling prices—potential reversal up.
Why does regular bearish divergence predict trend reversals?
Price makes higher highs but MACD makes lower highs, showing momentum is deteriorating even as price rises—buyers exhausting, reversal down likely.
What is the formula for the MACD line?
MACD = EMA₁₂(Price) - EMA₂₆(Price). It measures the gap between short-term and long-term momentum.
What does the MACD histogram represent?
The distance between the MACD line and Signal line. Growing histogram = accelerating momentum; shrinking = decelerating.
When does a centerline crossover occur?
When MACD crosses the zero line, meaning EMA₁₂ equals EMA₂₆—confirming a trend change.
What is hidden bullish divergence?
During an uptrend, price makes a higher low while MACD makes a lower low—confirms healthy pullback and trend continuation.
What's the key difference between regular and hidden divergence?
Regular divergence signals trend reversal (price and momentum diverge at extremes). Hidden divergence signals trend continuation (divergence during pullbacks/bounces).
Why should you confirm MACD crossovers with the histogram?
A crossover with a flat or shrinking histogram indicates weak momentum—likely a false signal. An expanding histogram confirms strong follow-through.
What does it mean when MACD "bounces off" the zero line?
In a strong trend, MACD pulls back to zero but doesn't cross—indicates healthy retracement before trend resumes. Trading opportunity.
Why is MACD less reliable in sideways markets?
MACD generates frequent crossovers in choppy conditions (whipsaws) because EMAs oscillate without clear trend direction—50-60% fail.
What timeframe is best for MACD trading?
Daily and weekly charts for swing trades. Lower timeframes (5-min, 15-min) produce too many false signals due to noise.
How should you manage risk when trading MACD divergence?
Wait for divergence and MACD crossover confirmation. Place stop-loss beyond the swing low/high that formed the divergence pattern.
What confirms a MACD crossover is high-probability?
(1) Crossover near zero line, (2) Expanding histogram, (3) Increased volume, (4) Alignment with higher timeframe trend.

Concept Map

EMA12 - EMA26

smoothing factor a=2 slash n+1

recent prices weighted more

EMA9 of MACD Line

MACD minus Signal

MACD minus Signal

measures momentum speed

crosses above Signal

crosses below Signal

buy signal

sell signal

contradicts price move

warns of

Price

MACD Line

EMA Weighting

Signal Line

Histogram

Momentum Strength

Bullish Crossover

Bearish Crossover

Trade Signals

Divergence

Trend Reversal

Hinglish (regional understanding)

Intuition Hinglish mein samjho

MACD indicator ko samajhne ke liye ek simple examplete hain. Maan lo apne ek stock kharida hai aur aap dekhna chahte ho ki momentum build ho raha hai ya fade ho raha hai. MACD line do exponential moving averages ka difference hai—12-day fast aur 26-day slow. Jab fast EMA slow sezyada door jata hai (positive gap), matlab short-term momentum strong hai. Signal line ek aur smoothing layer hai jo MACD ka9-day average leta hai.

Crossover tab hota hai jab MACD line signal line ko cross karti hai. Agar MACD upar cross kare (bullish crossover), matlab buyers ka pressure badh raha hai—potential buying opportunity. Agar neeche cross kare (bearish crossover), sellers dominate kar rahe hain—warning ki price gir sakta hai. Lekin sirf crossover pe blindly trade mat karo; histogram check karo. Histogram bata hai ki momentum accelerate ho raha hai ya decelerate. Agar crossover ke bad histogram bars bade ho rahe hain, strong signal hai. Agar flat ya shrink ho rahe hain, weak signal hai—probably whipsaw.

Divergence MACD ka sabse powerful concept hai. Jab price aur MACD opposite direction mein move karein, alarm bell hai. Agar price lower low bana raha but MACD higher low bana raha (bullish divergence), matlab selling pressure khatam ho raha hai—trend reversal ane wala hai upside. Similarly, agar price higher high but MACD lower high (bearish divergence), buying exhaustion hai—reversal downside possible hai. Hidden divergence thoda alag hai—wo trend continuation confirm karta hai. Uptrend mein agar pullback aaye aur price higher low banaye but MACD lower low, matlab healthy correction hai, trend continue karega.

Traders MACD ko isliye pasand karte hain kyunki wo lagging indicator hone ke bawajood trend change ko confirm kar deta hai clear visual signals ke sath. Histogram se speed of change bhi pata chalti hai real-time. Lekin yad rakho—sideways markets mein MACD bahut false signals deta hai, isliye trending marketsein hi use karo aur higher timeframes (daily/weekly) prefer karo intraday noise se bachne ke liye.

Test yourself — Indicators & Oscillators

Connections