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
The divergence part checks regular and hidden divergences between price and up to ten oscillators including RSI, MACD, stochastic, CCI, OBV, CMF and MFI, with an optional external series. Settings control pivot period, bars checked, minimum divergences, label style and colours. Structure shows swing breaks within a bar window and limit.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Divergence Pivot Period
int
5
prd
Source for Pivot Points
string
Close
source_div
Divergence Type
string
Regular
searchdiv
Show Indicator Names
string
Full
showindis
Minimum Number of Divergence
int
1
showlimit
Maximum Pivot Points to Check
int
10
maxpp
Maximum Bars to Check
int
100
maxbars
Show Divergence Number
bool
true
shownum
Don't Wait for Confirmation
bool
false
dontconfirm
Divergence: RSI
bool
true
calcrsi
Divergence: MACD
bool
true
calcmacd
Divergence: MACD Hist
bool
true
calcmacda
Show all 40 settings
Setting
Type
Default
Variable
Divergence: Stoch
bool
true
calcstoc
Divergence: CCI
bool
true
calccci
Divergence: Momentum
bool
true
calcmom
Divergence: OBV
bool
true
calcobv
Divergence: VWmacd
bool
true
calcvwmacd
Divergence: CMF
bool
true
calccmf
Divergence: MFI
bool
true
calcmfi
Divergence: External
bool
false
calcext
External Indicator
source
close
externalindi
Positive Regular Div Color
color
color.yellow
pos_reg_div_col
Negative Regular Div Color
color
color.navy
neg_reg_div_col
Positive Hidden Div Color
color
color.lime
pos_hid_div_col
Negative Hidden Div Color
color
color.red
neg_hid_div_col
SMC Window
int
5000
mswindow
Show Swing Structure
bool
true
showSwing
Swing Limit
int
100
swingLimit
SMC Bullish Color
color
#089981
swingcssup
SMC Bearish Color
color
#f23645
swingcssdn
SMC Pivot Length
int
5
mslen
Show Order Blocks
bool
true
obshow
OB Show Last
int
5
oblast
Bullish OB Color
color
color.new(#089981, 80)
obupcs
Bearish OB Color
color
color.new(#f23645, 80)
obdncs
OB Mitigation
string
Close
obmiti
Liquidity Pivot Length
int
14
liqLimit
Liquidity High Color
color
color.red
liqTopCss
Liquidity Low Color
color
color.teal
liqBtmCss
MA 1 Length
int
20
ma1Len
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
Bandz HTF projects higher-timeframe candle structures, ranges, and key levels directly onto the main price chart. It visualizes multiple configurable timeframe lanes from intraday to weekly alongside primary and macro range levels, including 25%, 50%, and 75%
This indicator combines Centered Triangular Moving Average (TMA) bands offset by Average True Range (ATR) with Smart Money Concepts (SMC) market structure analysis on the price chart. It calculates upper, center, and lower bands alongside swing and internal ma
Larper Suite is an overlay indicator for ICT and quarterly-theory analysis. It plots true session, daily, weekly, monthly, and yearly opens plus prior and current high-low liquidity levels. It tracks multi-asset SMT, swing divergence, fair-value-gap fills, and
Apex Protocol v3.0 - The SMC Engine is an overlay indicator designed for Smart Money Concepts (SMC) trading strategies. It detects market structure shifts (MSS), breaks of structure (BOS), M5 Fair Value Gaps (FVG), Order Blocks (OB), and Asian session ranges.
This overlay indicator classifies market structure with an ATR-based ZigZag that marks higher highs, higher lows, lower highs, and lower lows. A state machine plots buy and sell labels on the confirmation bar, not on the earlier pivot, and by default waits for