1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
273 lines of Pine Script v4 from Stochastic_RSI_Divergence+.txt, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.
Stochastic RSI Divergence+ detects bullish and bearish divergences by comparing price highs and lows to those of Stochastic RSI within a lookback period. Users set divergence range (short, medium, long), price tolerance, Stochastic tolerance, RSI and Stochastic lengths, smooth K and D values, and source. Pivots may be displayed optionally. Divergence signals indicate potential trend reversals. It repaints on live bars and lacks explicit stop loss or exit rules.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Price Lookback
int
10
barsback
Stoch RSI Lookback
int
6
lookback
Divergence Range
string
Short
shortRangeString
Price Epsilon (%)
float
1.0
priceTolerance
Stoch Epsilon (%)
float
1.0
stochTolerance
K
int
3
smoothK
D
int
3
smoothD
RSI Length
int
14
lengthRSI
Stochastic Length
int
14
lengthStoch
RSI Source
source
close
src
Display High/Low Pivots
bool
false
displayHighLows
Overlay Price Chart
bool
true
overlayMode
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator plots calendar-spread context for commodity futures on the price chart. It maps the chart symbol to front and next month contracts automatically, or uses manual symbols, then calculates the spread as a difference or ratio. Fast and slow EMAs, a
This indicator overlays multiple technical analysis tools onto the price chart to evaluate trend direction and trade setups. It computes an exponential moving average, a smoothed Stochastic RSI, a custom Williams Alligator using smoothed moving averages with o
Fractals with Divergence Scanner is an overlay indicator that combines Exponential Moving Averages, an eight-line EMA ribbon cloud, and WaveTrend divergence analysis. It calculates baseline EMA trends alongside WaveTrend oscillators to detect regular and hidde
ARPS Ultimate MultiStrategy Trading combines multiple technical indicators into a single chart overlay. It calculates and plots trend lines, moving averages, Ichimoku cloud components, Williams Alligator lines, and Fibonacci support and resistance levels direc
Complexity Trender is an indicator that combines EMA crossovers, RSI momentum, Stochastic signals, Bollinger Bands, ADX trend strength, volume analysis, and divergence detection to identify trends. It plots labels, trend lines, and a summary table directly on
The GBPJPY System is a MACD divergence strategy for the GBPJPY pair. It calculates MACD on the 1-hour timeframe, RCI on the current bar, and EMA on the 4-hour timeframe to detect trend reversals and divergences. The script plots entry signals, stop loss, take