Indicator · Pine Script v5 · Own pane

Momentum Divergence with Bollinger Bands

by caizongxun

This indicator calculates and plots Momentum, an exponential moving average of momentum, the Relative Strength Index (RSI), and KDJ oscillator lines in a separate pane.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code82
Settings13inputs
LicenceNone stated
Last update9 months ago22 Jan 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 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

Momentum Divergence with Bollinger Bands evaluates Bollinger Band bandwidth expansion alongside momentum acceleration to generate bullish and bearish divergence alert conditions when RSI or KDJ recover from oversold or overbought zones. User inputs configure calculation periods and smoothing for Bollinger Bands, Momentum, RSI, and KDJ, as well as toggle the visibility of individual plots. As an indicator, it generates alert triggers rather than automated execution orders.

Details

Published by

caizongxun on GitHub

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Oscillators & momentum, Volatility & bands, Divergence

Markets

Crypto

Timeframes

M15-H1, H4 and above

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
BB Lengthint20bb_length
BB Std Devfloat2.0bb_stddev
BB Sourcesourceclosesource_bb
Momentum Periodint12momentum_length
RSI Periodint14rsi_length
KDJ Periodint9kdj_period
KDJ Smooth Kint3kdj_smooth_k
KDJ Smooth Dint3kdj_smooth_d
Show Momentumbooltrueshow_momentum
Show RSIbooltrueshow_rsi
Show KDJbooltrueshow_kdj
Show BB Bandsbooltrueshow_bb_band
Show all 13 settings
SettingTypeDefaultVariable
Show Divergence Alertbooltrueshow_divergence_alert
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.

Similar Pine Scripts

330 stars

This indicator plots a TTM Squeeze momentum oscillator and a MACD line in a separate pane. It builds the squeeze oscillator from a linear regression of price against a high-low and simple moving average midpoint, and colors the area by slope and sign. Circles

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of TTM Squeeze + MACD line [Alorse]

Bubbles Indicator

by capissimo
114 stars

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

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Bubbles Indicator

TTM Squeeze Divergence

by TamaraKGreen
46 stars

The TTM Squeeze Divergence indicator plots a classic TTM Squeeze momentum oscillator in a separate pane alongside Bollinger Bands and Keltner Channels squeeze status dots on the zero line. It detects regular and hidden bullish and bearish divergences between p

Indicator v6 Oscillators & momentumVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of TTM Squeeze Divergence

Relative Strength Index

by deepentropy
13 stars

This indicator plots the Relative Strength Index in a separate pane from smoothed up and down price changes. It draws the RSI line with horizontal bands at 70, 50 and 30, plus overbought and oversold gradient fills. Optional settings add a smoothing moving ave

Indicator v6 Oscillators & momentumMoving averages
Updated 6 months ago · MIT GitHub repository of Relative Strength Index

QFA Pro Elite Refined

by JasonTeixeira
9 stars

This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers

Indicator v6 Oscillators & momentumVolatility & bands
Updated 12 days ago · Custom licence GitHub repository of QFA Pro Elite Refined

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers