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 strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
81 lines of Pine Script v5 from 8_Bollinger_Squeeze/8_Bollinger_Squeeze.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
When the squeeze releases, it evaluates linear regression momentum and optional volume spikes to confirm breakouts. Long signals occur on rising positive momentum, while short signals trigger on falling negative momentum. Positions are managed with ATR-based stop losses and configurable risk-to-reward profit targets, plotting Bollinger Bands and trade markers on the price chart.
Bollinger Band and Keltner Channel squeeze detection
Linear regression momentum measurement
Optional volume confirmation filter
ATR-based stop loss and fixed risk-to-reward target
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
BB Length
int
20
bbLength
BB StdDev Multiplier
float
2.0
bbMult
Keltner Channel Length
int
20
kcLength
KC ATR Multiplier
float
1.5
kcMult
Momentum Length
int
12
momLength
Require Volume Confirmation
bool
true
useVolConfirm
Volume MA Length
int
20
volLength
Volume Multiplier
float
1.2
volMult
ATR Length
int
14
atrLength
ATR Multiplier for SL
float
2.0
atrMult
Risk:Reward Ratio
float
2.5
rrRatio
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.
Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open
This strategy trades breakouts using VAMA Bands on the price chart. It supports long and short entries with filters from VAMA, MACD, DI, ADX, OBV and optional entry limits. Positions exit on opposite trend, force close periods or flip signals. Main settings ad
This strategy plots MACD line, signal line, Bollinger Bands, and RSI on the price chart. It signals long entries on MACD crossover above signal with RSI below 50 and price below BB basis, plus optional DMI filter. Short entries are available but disabled by de
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the