OPEN-SOURCE SCRIPT
RSI Divergence Confirmation

About This Script
RSI Divergence Confirmation identifies regular and hidden bullish and bearish divergences between price and the Relative Strength Index.
The indicator uses confirmed RSI pivot highs and lows as the anchor points for divergence detection. Price comparisons are based on the candle body, not the wick:
Bullish divergences use the lower body value: min(open, close).
Bearish divergences use the upper body value: max(open, close).
Divergence Types
Regular bullish: Price forms a lower body low while RSI forms a higher low.
Hidden bullish: Price forms a higher body low while RSI forms a lower low.
Regular bearish: Price forms a higher body high while RSI forms a lower high.
Hidden bearish: Price forms a lower body high while RSI forms a higher high.
Confirmation Arrows
A divergence is confirmed only when the first opposite-colored candle appears after the divergence setup:
Bullish divergence requires the first bullish candle.
Bearish divergence requires the first bearish candle.
That candle must have a body strictly larger than the previous candle’s body. If the first opposite candle fails this condition, a later candle cannot replace it.
Visual Features
Solid lines represent regular divergences.
Dashed lines represent hidden divergences.
Divergence lines are displayed on both the price chart and the RSI pane.
Price divergence lines are anchored using candle-body values rather than wick extremes.
Alert conditions are available for confirmed bullish and bearish divergences.
Pivot confirmation introduces a delay based on the selected right-pivot setting. Lower pivot values provide faster but more sensitive signals, while higher values produce fewer and more selective divergences. This indicator is intended as an analytical and alerting tool; it does not place trades.
RSI Divergence Confirmation identifies regular and hidden bullish and bearish divergences between price and the Relative Strength Index.
The indicator uses confirmed RSI pivot highs and lows as the anchor points for divergence detection. Price comparisons are based on the candle body, not the wick:
Bullish divergences use the lower body value: min(open, close).
Bearish divergences use the upper body value: max(open, close).
Divergence Types
Regular bullish: Price forms a lower body low while RSI forms a higher low.
Hidden bullish: Price forms a higher body low while RSI forms a lower low.
Regular bearish: Price forms a higher body high while RSI forms a lower high.
Hidden bearish: Price forms a lower body high while RSI forms a higher high.
Confirmation Arrows
A divergence is confirmed only when the first opposite-colored candle appears after the divergence setup:
Bullish divergence requires the first bullish candle.
Bearish divergence requires the first bearish candle.
That candle must have a body strictly larger than the previous candle’s body. If the first opposite candle fails this condition, a later candle cannot replace it.
Visual Features
Solid lines represent regular divergences.
Dashed lines represent hidden divergences.
Divergence lines are displayed on both the price chart and the RSI pane.
Price divergence lines are anchored using candle-body values rather than wick extremes.
Alert conditions are available for confirmed bullish and bearish divergences.
Pivot confirmation introduces a delay based on the selected right-pivot setting. Lower pivot values provide faster but more sensitive signals, while higher values produce fewer and more selective divergences. This indicator is intended as an analytical and alerting tool; it does not place trades.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.