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
BTMM TDI Divergence Scanner builds the index from a smoothed RSI, a signal line, and a longer baseline, then compares price and oscillator pivots over a lookback. Users can toggle each divergence type, set lookback, sensitivity, and minimum pivot distance, and show or hide lines, labels, and overbought and oversold bands. Optional alerts fire on divergences, level breaks, and signal crosses. It does not place trades or define exits.
Smoothed RSI TDI with signal and baseline
Regular and hidden divergence detection
Adjustable lookback, sensitivity, and pivot distance
Overbought and oversold level bands
Alerts for divergences, level breaks, and signal crosses
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
RSI Length
int
13
rsi_length
RSI Smoothing
int
2
rsi_smooth
Signal Line Length
int
7
signal_length
Base Line Length
int
34
base_line_length
Show TDI Lines
bool
true
show_tdi_lines
Enable Regular Divergence
bool
true
enable_regular_divergence
Enable Hidden Divergence
bool
true
enable_hidden_divergence
Divergence Lookback Period
int
15
divergence_lookback
Divergence Sensitivity
float
1.0
divergence_sensitivity
Minimum Pivot Distance
int
5
min_divergence_distance
Show Divergence Lines
bool
true
show_divergence_lines
Show Divergence Labels
bool
true
show_divergence_labels
Show all 19 settings
Setting
Type
Default
Variable
Show TDI Overbought/Oversold
bool
true
show_tdi_levels
Overbought Level
float
68.0
overbought_level
Oversold Level
float
32.0
oversold_level
Divergence Alert Notifications
bool
true
enable_divergence_alerts
TDI Level Break Alerts
bool
true
enable_tdi_level_alerts
TDI Signal Cross Alerts
bool
true
enable_signal_cross_alerts
Alert Frequency
string
once_per_bar
alert_frequency
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 calculates momentum setups based on the Relative Strength Index (RSI) and plots in a separate pane. It offers multiple scanning modes such as Continuous Break, Continuous Retracement, Flip Break, Flip Retracement, and both regular and hidden div
This indicator calculates the MACD oscillator from a configurable source with fast and slow lengths, then plots the histogram, MACD line, and signal line in a separate pane. It detects regular bullish divergences (price lower lows with oscillator higher lows),
This indicator calculates the Relative Strength Index (RSI) across four user-selected timeframes and plots the results in a separate pane. It identifies regular bullish and bearish divergences between price pivot points and the primary timeframe RSI value. Add
The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend
This indicator plots a standard Relative Strength Index (RSI) in a separate pane alongside customizable overbought and oversold threshold levels with shaded fills. It identifies pivot highs and lows on the oscillator to detect regular and hidden bullish and be
This indicator calculates a 14-period RSI from close and plots it in a separate pane with dotted overbought and dashed oversold lines at 70 and 30. It marks bullish divergence when a five-bar pivot low in price is lower than the price twenty bars earlier while