# RSI Divergence & Momentum Oscillator

- Canonical: https://rxm.orrnn.com/codebase/rsi-divergence-momentum-oscillator
- Updated: 2026-12-02T01:51:53.265619-08:00

> Separate-pane RSI oscillator with pivot-based bullish/bearish divergence detection and overbought/oversold threshold lines.

Detects hidden and regular RSI divergences with clean hlines at 30/50/70.

```orrnn
//@orrnn=1
indicator("RSI Divergence Oscillator", overlay = false, max_bars_back = 300)

let len = input.int(14, title = "RSI Period", minval = 2, maxval = 50)
let r = ta.rsi(close, len)

plot(r, title = "RSI", color = color.primary, linewidth = 2)
hline(70, title = "Overbought", color = color.danger)
hline(50, title = "Midline", color = color.neutral)
hline(30, title = "Oversold", color = color.success)
```
