Back to RSI
RSI

RSI Divergence

Divergence occurs when price and RSI move in opposite directions — price making a new high while RSI makes a lower high, or vice versa. It's a warning that momentum is fading. We detect four types: Regular Bullish, Regular Bearish, Hidden Bullish, and Hidden Bearish.

❓ Why It Matters

Divergence is one of the few leading signals in technical analysis — it often precedes a reversal before price confirms. Regular divergence suggests a trend is about to reverse; hidden divergence suggests a trend is about to continue. It's a favourite of experienced traders for early entries.

📐 The Formula
Using swing points (order=3) over a 20-day lookback window: Regular Bullish → Price makes LOWER LOW, RSI makes HIGHER LOW Regular Bearish → Price makes HIGHER HIGH, RSI makes LOWER HIGH Hidden Bullish → Price makes HIGHER LOW, RSI makes LOWER LOW Hidden Bearish → Price makes LOWER HIGH, RSI makes HIGHER HIGH Otherwise → 'No divergence'
🔌 Data Sources

Computed

🔬 How We Compute It

We use argrelextrema to find swing highs and lows in both the price series and the RSI series. Then we compare the last two swing points in each series over a rolling 20-day window. When price and RSI disagree on direction, we classify the divergence type.

📊 How to Read It
  • Regular Bullish → potential reversal UP; strongest when RSI was oversold.
  • Regular Bearish → potential reversal DOWN; strongest when RSI was overbought.
  • Hidden Bullish → continuation of an uptrend expected.
  • Hidden Bearish → continuation of a downtrend expected.
  • 'No divergence' means price and momentum are aligned.
  • Divergence is a warning, not a trigger — wait for price confirmation.
⚠️ Common Mistakes
  1. Acting on divergence immediately — it can persist for weeks before price responds.
  2. Missing hidden divergences — they're less famous but equally useful.
  3. Over-trading — divergences are common; filter for ones that occur at obvious support/resistance.
🔗 Related Metrics

Stockenza Method · Updated 2026-10-14 · Educational use only