CDC RSI Divergence
Oct 12, 2016

The CDC RSI Divergence indicator identifies potential trend reversals by detecting bullish and bearish divergences between price action and the Relative Strength Index (RSI). This tool assists traders in spotting exhausted market trends where price reaches new extremes while momentum fails to follow, providing visual alerts and shaded zones to highlight these occurrences.
Usage
The tool can be used to identify areas where price momentum is shifting. It should be used as a guideline alongside other technical analysis tools, such as the MACD or volume indicators, rather than a standalone entry or exit signal.
- Bullish Divergence: Occurs when the price makes a lower low while the RSI makes a higher low (specifically within the oversold region). This is visualized as a green shaded zone above the 50 level.
- Bearish Divergence: Occurs when the price makes a higher high while the RSI makes a lower high (specifically within the overbought region). This is visualized as a red shaded zone below the 50 level.
The indicator uses specific lookback periods to compare recent price extremes with historical ones. Because the detection logic involves identifying local peaks and troughs, users should be aware that signals may confirm slightly after the physical pivot point occurs.
Details
The script calculates divergence by comparing a "Short Lookback Period" (representing the current price/RSI action) against a "Long Lookback Period" (representing the historical benchmark).
- Bullish Condition: Price must have recently bounced slightly (controlled by the Reversal Percentage) from a low that is lower than the previous long-term low, while the RSI low must be higher than its previous long-term low.
- Bearish Condition: Price must have recently retraced from a high that is higher than the previous long-term high, while the RSI high must be lower than its previous long-term high.
The "Alert Period" setting determines how long the visual shaded zone remains active on the chart after a divergence is detected.
Settings
- Data Source: Selects the price series used for calculations (default is OHLC4).
- Short Lookback Period: The window used to find the most recent price and RSI extremes.
- Long Lookback Period: The window used to find the historical price and RSI extremes for comparison.
- Reversal Percentage: The percentage price must move away from an extreme to confirm a pivot.
- Alert Period: The number of bars the divergence signal remains visible on the oscillator pane.
- RSI Period: The length of the RSI calculation.
- Overbought Level: The threshold for bearish divergence detection (default 70).
- Oversold Level: The threshold for bullish divergence detection (default 30).
FAQ
How do I interpret the shaded zones?
The green zones represent a recent Bullish Divergence, while red zones represent a recent Bearish Divergence. These zones persist for the duration of the "Alert Period" defined in the settings.
Does this indicator repaint?
The indicator identifies divergences based on local price reversals. While it does not "repaint" historical data in a deceptive way, the signal confirms only after the price has moved a certain percentage away from the peak or trough.
How can I access CDC RSI Divergence?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.