All indicators

Stochastic RSI with Divergences

Aug 8, 2018

Static chart image
SignalsOscillatorsDivergences

The Stochastic RSI with Divergences indicator combines the momentum sensitivity of the Stochastic RSI with an automated divergence detection system to help traders identify potential trend reversals and continuations.

Usage

The tool displays the standard Stochastic RSI (K and D lines) alongside visual labels for regular and hidden divergences. Traders can use the Stochastic RSI to identify overbought (>80) and oversold (<20) conditions, while the divergence labels highlight discrepancies between price action and momentum.

  • Regular Bullish Divergence (R): Occurs when price makes a lower low but the oscillator makes a higher low, suggesting a potential upward reversal.
  • Regular Bearish Divergence (R): Occurs when price makes a higher high but the oscillator makes a lower high, suggesting a potential downward reversal.
  • Hidden Divergences (H): If enabled, these signal trend continuation (e.g., a higher low in price with a lower low in the oscillator for a bullish trend).
  • Average Mode: When enabled, the divergence logic can be calculated based on the average of the K and D lines for a smoother response.

Details

The script utilizes a fractal-based approach to identify peaks and troughs in the oscillator. It includes a logarithmic calculation toggle for the source price, which can normalize price data for more consistent RSI results over long timeframes. The divergence detection logic is based on work by RicardoSantos and JustUncleL, modified to fit the Stochastic RSI framework.

Settings

Main Settings

  • Smooth K: The smoothing period for the %K line.
  • Smooth D: The moving average period for the %D line.
  • Length RSI: The lookback period for the underlying RSI calculation.
  • Length Stoch: The lookback period for the Stochastic calculation.
  • Log: Toggles the use of logarithmic price data for calculations.
  • Source: The price source used for the calculations (default is Close).

Visibility & Logic

  • Show Divergences: Toggles the display of all divergence labels and markers.
  • Show Hidden Divergences: Enables or disables the detection of hidden divergence patterns.
  • Show Divergences Channel: Displays lines connecting fractal points on the oscillator.
  • Use Average of both K & D: Changes the divergence detection source to the average value of the K and D lines rather than just the K line.

FAQ

How do I use the Stochastic RSI with Divergences?

You can use it to identify overextended market conditions and potential turning points. Look for "R" labels in overbought or oversold zones for higher-probability reversal signals.

What is the difference between Regular and Hidden divergences?

Regular divergences suggest a potential trend reversal, while hidden divergences typically suggest that the current trend is likely to continue.

How can I access this tool?

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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.