Better Stochastic RSI to find Divergences
Jan 26, 2020

The Better Stochastic RSI to find Divergences indicator provides a modified stochastic oscillator designed to enhance the identification of divergences between price action and momentum while highlighting overbought and oversold market conditions.
Usage
The indicator can be used to identify potential trend reversals through the observation of price/oscillator divergences. When price makes a higher high but the oscillator makes a lower high, a bearish divergence is present. Conversely, when price makes a lower low but the indicator makes a higher low, a bullish divergence occurs.
Additionally, traders can use the indicator to identify extreme market conditions:
- Overbought: When the oscillator value rises above the "Over Bought" level (default 80), it suggests the asset may be overextended to the upside.
- Oversold: When the oscillator value falls below the "Over Sold" level (default 20), it suggests the asset may be overextended to the downside.
The optional signal line can be enabled to provide crossover signals for momentum confirmation.
Details
The script calculates a modified Stochastic RSI by analyzing the relationship between the current RSI and its highest/lowest values over a specific lookback period. It applies a Simple Moving Average (SMA) to these differences to smooth the output, resulting in the "Average High Low" calculation. The formula converts these smoothed relationships into a normalized scale from 0 to 100.
Settings
- RSI Length: The period used to calculate the underlying Relative Strength Index.
- Look Back Length: The window used to find the highest and lowest RSI values for the stochastic calculation.
- Average Length: The length of the SMA applied to the differences to smooth the oscillator.
- Signal On/Off?: Toggles the visibility of a secondary signal line based on the oscillator's average.
- Signal Length: The period used for the signal line's SMA.
- Source: The price data input used for calculations (typically "close").
- Over Bought: The upper threshold level for identifying overbought conditions.
- Over Sold: The lower threshold level for identifying oversold conditions.
FAQ
How do I use the Better Stochastic RSI to find Divergences for trend confirmation?
Look for the oscillator to be moving in the same direction as price. If the oscillator fails to confirm new price extremes, it may indicate a weakening trend.
What is the advantage of using this over a standard Stochastic RSI?
This version uses an averaging technique on the high-low range of the RSI, which can result in a smoother oscillator that is less prone to "choppy" signals in volatile markets.
How can I access this indicator?
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.