RSI Divergences + Bollinger Bands
Jan 13, 2022

The RSI Divergences + Bollinger Bands indicator is a comprehensive momentum oscillator tool that combines Relative Strength Index (RSI) analysis with volatility bands and automated divergence detection to identify potential trend reversals and exhaustion points.
Usage
The Usage section focuses on interpreting the various visual components of the indicator:
- RSI Signal: The primary RSI line changes color dynamically. It turns red when overbought (above 70) and green when oversold (below 30), providing immediate visual feedback on market extremes.
- Bollinger Bands: Bollinger Bands are applied directly to the RSI oscillator rather than the price. This helps traders identify when the RSI itself is reaching statistical extremes relative to its recent average.
- Divergence Labels: The script automatically identifies "Bull" and "Bear" labels on the oscillator. A regular bullish divergence occurs when price makes a lower low but the RSI makes a higher low, suggesting weakening downward momentum. Conversely, regular bearish divergences occur when price makes a higher high but RSI makes a lower high.
- Hidden Divergences: Users can optionally enable hidden divergences to identify potential trend continuation signals.
- Area Fills: The indicator highlights areas where the RSI exceeds the 70 or 30 thresholds with color-coded fills, making it easier to spot prolonged periods of overextension.
Details
This script implements a refined version of the RSI by integrating Bollinger Bands as a secondary volatility filter. By observing how the RSI interacts with its own Bollinger Bands, traders can gain insights into whether an overbought or oversold condition is becoming extreme or if the momentum is beginning to revert to the mean.
The divergence detection logic utilizes pivot points (highs and lows) within a user-defined lookback window. It compares these oscillator pivots against price action to confirm structural discrepancies. The inclusion of Bollinger Bands on the RSI allows for "squeeze" analysis within the momentum domain, highlighting periods of low momentum volatility that often precede significant moves.
Settings
RSI & Divergence Settings
- RSI Period: The number of bars used to calculate the RSI (default is 14).
- RSI Source: The price source used for the RSI calculation.
- Pivot Lookback Right/Left: Determines the number of bars required to confirm a pivot high or low.
- Max/Min Lookback Range: Defines the distance range (in bars) to look for previous pivots when identifying divergences.
- Plotting Toggles: Allows users to enable or disable the display of Regular Bullish, Hidden Bullish, Regular Bearish, and Hidden Bearish signals.
Bollinger Bands Settings
- BB Length: The lookback period for the Bollinger Bands calculated on the RSI.
- BB StdDev: The standard deviation multiplier for the width of the bands.
- BB Offset: Shifts the Bollinger Bands forward or backward in time on the chart.
FAQ
How do I use the Bollinger Bands on the RSI?
When the RSI line touches or crosses the upper or lower Bollinger Bands, it indicates that the momentum has reached a statistical extreme. A cross back inside the bands from an overextended state is often viewed as a mean-reversion signal.
What is the difference between Regular and Hidden Divergences?
Regular divergences typically signal a potential trend reversal, whereas hidden divergences often suggest a continuation of the prevailing trend.
How can I access RSI Divergences + Bollinger Bands?
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.