# RSI Divergence

<mark style="color:$info;">The RSI Divergence module detects when</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**price and momentum move in opposite directions**</mark><mark style="color:$info;">, revealing hidden shifts in market strength before trend reversals occur.</mark>

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2Fcn9OiZ1WkKwRA0PlY2c6%2Fimage.png?alt=media&#x26;token=92897736-6090-4936-a0b2-e8333359f964" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">This feature helps traders spot potential turning points that are often invisible in raw price action, making it a key element of the Ultimate RSI Suite.</mark>

***

### Divergence Logic

<mark style="color:$info;">The indicator continuously compares swing highs and lows on RSI against swing highs and lows on price within a defined lookback range.</mark>

* <mark style="color:$info;">**Regular Bullish Divergence:**</mark>\ <mark style="color:$info;">Price makes a lower low, while RSI forms a higher low.</mark>\ <mark style="color:$info;">This signals weakening bearish momentum and a potential reversal upward.</mark>
* <mark style="color:$info;">**Regular Bearish Divergence:**</mark>\ <mark style="color:$info;">Price makes a higher high, while RSI forms a lower high.</mark>\ <mark style="color:$info;">This signals fading bullish strength and a possible reversal downward.</mark>

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FQoKYvwxiLBSbAOSPOE4I%2Fimage.png?alt=media&#x26;token=d655eb99-3fb1-413d-95c1-76f3111cee4c" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">Each divergence is confirmed only when both RSI and price structure complete their swings, ensuring reliable signals rather than premature markings.</mark>

<div data-with-frame="true"><figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FOKE69XPemzb9SmFvsHRm%2Fimage.png?alt=media&#x26;token=ffb1926f-ff8f-422e-b92c-6e4e26d6fe54" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %} <mark style="color:$info;">Controlled by the “Divergence Length” setting (default: 10).</mark>\ <mark style="color:$info;">This defines how many bars the algorithm scans for relevant swing points.</mark>
{% endhint %}

***

### Deviation Tracking (+1 / +2)

<mark style="color:$info;">When enabled,</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**Deviation Mode**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">adds dynamic follow-through tracking to each divergence.</mark>\ <mark style="color:$info;">It projects two Volatility-based levels labeled</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**+1**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">and</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**+2**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">from the signal candle to monitor how the market reacts after divergence confirmation.</mark>

* <mark style="color:$info;">**+1 Cross:**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">Indicates initial continuation strength.</mark>
* <mark style="color:$info;">**+2 Cross:**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">Signals strong confirmation that the reversal is developing.</mark>

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FkhJDbtlNEkA2tZjczIdT%2Fimage.png?alt=media&#x26;token=09cc9af1-9135-477b-9e0e-59e6ce85b94a" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">Each level changes to a dashed style once price touches it, providing clear visual feedback that the deviation has completed.</mark>

<div data-with-frame="true"><figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FVAOi5h6m5bGNgNJBZyyf%2Fimage.png?alt=media&#x26;token=9042b0d1-1773-451f-86da-ee48baf22bbe" alt=""><figcaption></figcaption></figure></div>

<mark style="color:$info;">This feature turns divergence detection into a fully interactive confirmation framework, not just static labeling.</mark>

***

### Hidden Divergence Logic

<mark style="color:$info;">While regular divergence signals a potential trend reversal, hidden divergence suggests that the current trend is strong and likely to continue.</mark>

* <mark style="color:$info;">Hidden Bullish Divergence: Price makes a higher low, while RSI forms a lower low. This indicates that despite the dip in momentum, the buyers are still holding a higher floor, suggesting the uptrend will continue.</mark>
* <mark style="color:$info;">Hidden Bearish Divergence: Price makes a lower high, while RSI forms a higher high. This indicates that even though momentum spiked, the price couldn't break the previous ceiling, suggesting the downtrend will continue.</mark>

<div><figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FusMLOsETRJjitocyJZKp%2Fimage.png?alt=media&#x26;token=342a8471-73a8-446d-8112-36770ad592cc" alt=""><figcaption><p>Bearish Hidden Divergence</p></figcaption></figure> <figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FGLicqh8atJ6Hf4YBYe1I%2Fimage.png?alt=media&#x26;token=33cb91c1-a3aa-4287-bebf-5a5d29fb6fd1" alt=""><figcaption><p>Bullish Hidden Divergence</p></figcaption></figure></div>

### Settings

<div data-with-frame="true"><figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2F5qoz1ayOqDGLoKh0kCj6%2Fimage.png?alt=media&#x26;token=81faa8bd-cdf8-4afd-a8dd-69a78554c6e7" alt=""><figcaption></figcaption></figure></div>

| Setting    | Description                                                                                |
| ---------- | ------------------------------------------------------------------------------------------ |
| Divergence | Lookback Range. Sets how many candles back the script looks for highs and lows.            |
| Deviation  | Sensitivity. Adjusts the calculation for the +1/+2 levels and filters out "noisy" signals. |
| Hidden     | Trend Continuation. Toggle to show or hide Hidden Divergence signals.                      |
