JB RSI Divergence
- Indicators
- Version: 1.0
- Activations: 5
JB RSI Divergence — Automatic Divergence Detection with Visual Lines
Standard RSI shows overbought and oversold — but the real power of RSI is in divergences. When price makes a new high but RSI makes a lower high, the move is losing momentum. A reversal is coming.
The problem? Spotting divergences manually is tedious, subjective, and easy to miss in real-time. By the time you draw the lines, the move has already started.
This indicator solves this by detecting ALL four divergence types automatically and drawing them directly on the RSI window with labeled trendlines:
Regular Bearish (BR) — price makes higher high, RSI makes lower high. Strongest reversal signal. The trend is exhausted, sellers are stepping in.
Hidden Bearish (HBR) — price makes lower high, RSI makes higher high. Trend continuation signal in a downtrend. The pullback is fake, the downtrend will resume.
Regular Bullish (BL) — price makes lower low, RSI makes higher low. Reversal signal. Buyers are accumulating despite lower prices.
Hidden Bullish (HBL) — price makes higher low, RSI makes lower low. Trend continuation in an uptrend. The dip is a buying opportunity.
What makes this version unique:
Closed-Bar Detection — divergences are detected on confirmed bars only (shift >= 3), not on the current forming bar. This eliminates false signals from incomplete candles.
RSI Efficiency Ratio — Kaufman ER applied on breakout from divergence lines. Shows whether the breakout has momentum or is likely to fail. Displayed as a real-time label.
Straddle Hysteresis — 48-52 buffer zone around RSI level 50. Prevents flip-flop signals when RSI oscillates around the midline.
Line Change Tolerance — small drifts (< 2 pts) in divergence lines maintain the current state. Only significant changes (>= 2 pts) trigger a reset. Reduces noise.
Visual Clarity — each divergence type has its own color-coded trendline with a clear label (BR, HBR, BL, HBL) directly on the chart. No guessing what the signal means.
EA-Ready Buffers — all values accessible via iCustom() or CopyBuffer():
- Buffer 0: RSI line value
- Buffer 1: Regular Bearish divergence
- Buffer 2: Hidden Bearish divergence
- Buffer 3: Regular Bullish divergence
- Buffer 4: Hidden Bullish divergence
- Buffer 5: Last bearish divergence level
- Buffer 6: Last bullish divergence level
Works on any symbol (Forex, Indices, Crypto, Commodities) and any timeframe.
Why this instead of standard RSI:
- Standard RSI only shows levels (30/50/70). This shows divergences — the predictive signal.
- Manual divergence detection is slow and subjective. This is instant and consistent.
- 4 divergence types detected (regular + hidden, bullish + bearish) — most indicators only detect regular.
- Efficiency Ratio on breakout tells you if the divergence signal has real momentum behind it.
- All buffers available for EA automation — build divergence trading systems.
