Filtered RSI Divergence Finder
Jan 19, 2019

The Filtered RSI Divergence Finder indicator identifies regular and hidden RSI divergences with advanced filtering capabilities to help traders pinpoint higher-quality signals. By incorporating time and price change constraints, it streamlines the identification of divergence patterns that meet specific volatility and duration criteria.
Usage
The tool displays regular (R) and hidden (H) divergences directly on the chart. Traders can use this script to identify potential trend reversals (regular divergences) or trend continuations (hidden divergences).
The key functionality of this indicator lies in its filtering system:
- Filtering: Signals are only displayed if they meet the minimum/maximum bar length and price percentage change requirements.
- Ghost Divergences: When enabled, the indicator shows "ghost" divergences—faded labels and lines representing signals that were filtered out. This allows users to visualize what the filters are excluding and fine-tune the settings for specific market conditions.
- Inverted Signals: Users can invert signal colors to match their personal chart preferences or specific strategies.
Details
The script utilizes fractal-based logic to detect peaks and troughs in the Relative Strength Index (RSI). It calculates divergences by comparing the relationship between price action (Higher Highs/Lower Lows) and RSI oscillator movement.
- Regular Bearish Divergence: Occurs when price makes a higher high, but the RSI makes a lower high.
- Regular Bullish Divergence: Occurs when price makes a lower low, but the RSI makes a higher low.
- Hidden Bearish Divergence: Occurs when price makes a lower high, but the RSI makes a higher high.
- Hidden Bullish Divergence: Occurs when price makes a higher low, but the RSI makes a lower low.
Credits to RicardoSantos for the original divergence detection concepts used in this implementation.
Settings
General
- Source: The price data source used for calculations (e.g., Close).
- RSI Length: The lookback period for the RSI calculation.
- Show Regular Divergences: Toggles the visibility of regular divergence signals.
- Show Hidden Divergences: Toggles the visibility of hidden divergence signals.
- Show Labels: Enables or disables the 'R' and 'H' text labels on the chart.
- Show Channel: Toggles the visibility of the channel lines.
- Show Divergence Lines: Displays lines connecting the fractal points of the divergence.
Filter Settings
- Show Filtered Ghost Divergences?: Displays rejected signals in a faded "ghost" style for tuning purposes.
- Minimum bar length: The minimum number of bars required between divergence points.
- Maximum bar length: The maximum number of bars allowed between divergence points.
- Minimum price change %: The minimum percentage price movement required between the two points of the divergence.
- Maximum price change %: The maximum percentage price movement allowed between the two points of the divergence.
Visuals
- Invert Signal Colours: Swaps the standard green/red signal colors.
FAQ
How do I use the "Ghost" divergences?
Ghost divergences are signals that failed the filter criteria. If you see many ghost signals that look profitable, you can adjust your "Minimum price change" or "Bar length" settings to include them in the active signals.
What is the difference between Regular and Hidden divergences?
Regular divergences typically suggest a potential trend reversal, while hidden divergences often indicate trend continuation.
How can I access Filtered RSI Divergence Finder?
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.