RSI Divergence
Aug 20, 2018

The RSI Divergence indicator identifies potential trend reversals by highlighting discrepancies between price action and the Relative Strength Index (RSI) over a user-defined lookback period.
Usage
The tool is primarily used to spot exhaustion in current trends. A bullish divergence is identified when the price reaches a new low within the lookback period, but the RSI remains above its recent minimum, suggesting a loss in downward momentum. Conversely, a bearish divergence occurs when the price hits a new high, but the RSI fails to reach a new peak, indicating weakening upward pressure.
Users can look for these highlighted signals to anticipate potential market rotations or to confirm existing trend-following strategies.
Details
The script calculates the standard RSI and monitors it alongside price extremes.
- Bearish Condition: Price is at or above the highest close of the lookback period, while the RSI is below its recent high (specifically when that high was in overbought territory above 70).
- Bullish Condition: Price is at or below the lowest close of the lookback period, while the RSI is above its recent low (specifically when that low was in oversold territory below 30).
The indicator includes built-in background coloring for visual clarity and alert conditions for real-time monitoring.
Settings
- RSI Length: Determines the period used to calculate the Relative Strength Index (default is 14).
- Lookback: Sets the number of bars used to determine the highest and lowest price and RSI points for comparison.
FAQ
How do I interpret the background colors?
Green background highlights indicate a Bullish RSI Divergence, while red background highlights indicate a Bearish RSI Divergence.
Can I change the sensitivity of the signals?
Yes, by adjusting the Lookback setting. A smaller lookback will produce more frequent signals based on short-term peaks/valleys, while a larger lookback will filter for more significant divergences.
How can I access the 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.