1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
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
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
CB RSI (Divergence and OB/OS) detects divergences by comparing price highs and lows to RSI values using pivot points with configurable lookback bars. Signals appear as triangle shapes below or above the bar for bullish and bearish divergences respectively. The script also includes RSI overbought and oversold levels with base zone lines that users can adjust to filter signals based on sequenced and non-sequenced conditions. Divergence signals trigger when RSI crosses the overbought or oversold thresholds.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Overbought
float
72
i_rsiOb
RSI Oversold
float
28
i_rsiOs
Pivot Lookback Bars
int
2
lback
Additional Vertices Lookback
int
1
vertLback
RSI Timeframe
timeframe
rsiRes
Overbought Base Line
float
55
obBaseZn
Oversold Base Line
float
45
osBaseZn
Threshold Sequenced Overbought/Oversold
int
2
minSeqObOs
Threshold Non-sequenced Overbought/Oversold
int
4
minNsqObOs
Sum Sequenced/Non-sequenced Overbought/Oversold
bool
true
useSumObOs
Threshold Summed Overbought/Oversold
int
4
minSumObOs
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 collection calculates and plots previous daily high and low price levels on the chart to identify potential supply and demand zones. It includes real-time intraday high and low calculations, RSI divergence detection across a customizable period
This indicator implements a full Chanlun pipeline on the price chart. It merges contained bars, marks top and bottom fractals, and connects alternating fractals into strokes. Overlapping strokes form pivot boxes, and MACD area ratios flag trend or consolidatio
This price-chart indicator finds swing highs and lows with a user-set pivot length and classifies them as higher high, lower high, higher low, or lower low. It tracks a trend state and the latest swing signal from those pivots. The same swing comparison is run
SAB PRO Pivot Master is a price-chart overlay that builds an RSX-style oscillator from a chosen source and length, then compares price extremes with that oscillator over a lookback window to mark pivots and bullish or bearish divergence. Overbought and oversol
This indicator detects regular and hidden divergences across multiple technical indicators including RSI, MACD, Stochastic, CCI, momentum, OBV, and others. It calculates pivot points on a chosen source to identify bullish and bearish divergences, then plots co
Divergence-Support/Resistence combines dual Zigzag pivot detection with momentum oscillators to identify divergence patterns and plot support and resistance levels directly on the price chart. Users can select from various built-in oscillators, such as RSI, CC