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.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.