Bollinger Bands Buy Sell Signals — TradingView Guide
Bollinger Bands buy sell signals for TradingView. Squeeze, band touch, and volatility breakout signals with Pine Script code, parameter settings, and real backtest results.
Bollinger Bands Signal Interpretation
Quick-reference guide to 6 signal types you will see on the chart.
| Signal Type | Indicator Condition | Market Meaning | Reliability |
|---|---|---|---|
| Band Touch Reversal → Buy | Price touches the lower Bollinger Band and closes back inside the band | Price reached an extreme down move. Expect a mean reversion bounce. Strongest when the band slope is flat or rising. | 3/5 |
| Band Touch Reversal → Sell | Price touches the upper Bollinger Band and closes back inside the band | Price reached an extreme up move. Expect a pullback or mean reversion. More reliable in range markets. | 3/5 |
| Bollinger Squeeze → Breakout | Band width contracts to a multi-period low (typically lower than the previous 6 squeezes) | Volatility is compressing. A sharp expansion is coming, but the direction is unknown until price breaks the band. | 4/5 |
| Ride the Band → Trend | Price walks along the upper or lower band for 3+ consecutive bars without closing inside | Strong trending conditions. Price is following the band, not reversing off it. Do not fade this move. | 4/5 |
| %B Band Walk to Middle → Re-entry | %B crosses from extreme (<0 or >1) back to the 0.5 middle band level | Pullback within a trend completes. Trend continuation likely. Works as a re-entry signal after a trend pause. | 3/5 |
| Band Width Expansion → Volatility Signal | Bollinger Band width expands rapidly after a squeeze, band width > 2 standard deviations above its 20-period average | Volatility spike confirmed. The market is entering a high-momentum phase. Trade in the breakout direction with wider stops. | 3/5 |
Bollinger Bands Pine Script Signal Code
Ready-to-use Pine Script code for generating buy/sell signals. Copy and paste into your TradingView Pine Editor.
//@version=5
indicator("Bollinger Bands Buy Sell Signals", overlay=true)
bbLength = input.int(20, "BB Length")
bbMult = input.float(2.0, "BB Std Dev")
src = input.source(close, "Source")
squeezeLookback = input.int(20, "Squeeze Lookback", tooltip="Number of bars for squeeze comparison baseline")
// Bollinger Bands calculation
basis = ta.sma(src, bbLength)
dev = bbMult * ta.stdev(src, bbLength)
upper = basis + dev
lower = basis - dev
// Band width
bandWidth = upper - lower
avgBandWidth = ta.sma(bandWidth, squeezeLookback)
// %B indicator
pctB = (src - lower) / (upper - lower)
// Buy signal: price touches lower band, closes back inside
lowerTouch = low <= lower
lowerBounce = close > lower
buySignal = lowerTouch and lowerBounce and close > open
// Sell signal: price touches upper band, closes back inside
upperTouch = high >= upper
upperReject = close < upper
sellSignal = upperTouch and upperReject and close < open
// Squeeze detection
isSqueeze = bandWidth < avgBandWidth and bandWidth < bandWidth[squeezeLookback]
squeezeBreakoutUp = isSqueeze[1] and close > upper
squeezeBreakoutDown = isSqueeze[1] and close < lower
// Band walk detection: 3+ consecutive closes outside a band
walkUp = close > upper and close[1] > upper[1] and close[2] > upper[2]
walkDown = close < lower and close[1] < lower[1] and close[2] < lower[2]
// Plot Bollinger Bands
plot(basis, "Basis", color=#2962FF, linewidth=2)
p1 = plot(upper, "Upper", color=#FF5252, linewidth=1)
p2 = plot(lower, "Lower", color=#4CAF50, linewidth=1)
fill(p1, p2, color=color.new(color.gray, 92), title="Band Fill")
// Plot buy and sell signals on the price chart
plotshape(buySignal, "Buy Signal", shape.triangleup, location.belowbar, color=#4CAF50, size=size.small)
plotshape(sellSignal, "Sell Signal", shape.triangledown, location.abovebar, color=#FF5252, size=size.small)
// Squeeze markers
plotshape(squeezeBreakoutUp, "Squeeze Buy", shape.labelup, location.belowbar, color=#00BCD4, size=size.small)
plotshape(squeezeBreakoutDown, "Squeeze Sell", shape.labeldown, location.abovebar, color=#FF9800, size=size.small)
// Band walk labels
plotshape(walkUp, "Band Walk Up", shape.circle, location.abovebar, color=#E040FB, size=size.tiny)
plotshape(walkDown, "Band Walk Down", shape.circle, location.belowbar, color=#E040FB, size=size.tiny)
// Band width subplot
hline(0, "Zero Line", color=#757575, linestyle=hline.style_dotted)
plot(bandWidth, "Band Width", color=#757575, display=display.none)
alertcondition(buySignal, "BB Lower Band Bounce Buy", "Price closed above the lower Bollinger Band after touching it")
alertcondition(sellSignal, "BB Upper Band Rejection Sell", "Price closed below the upper Bollinger Band after touching it")
alertcondition(isSqueeze, "BB Squeeze", "Bollinger Band width is at a multi-period low")
alertcondition(squeezeBreakoutUp, "BB Squeeze Breakout Up", "Price broke above upper band after a squeeze")
alertcondition(squeezeBreakoutDown, "BB Squeeze Breakout Down", "Price broke below lower band after a squeeze")Recommended Parameters for Bollinger Bands
Parameter settings tested across different market conditions and timeframes.
| Parameter | Default | Description |
|---|---|---|
| BB Length | 20 | Number of bars used for the middle SMA and standard deviation calculation. 20 is standard for daily charts. I use 15 on 5m NQ charts for faster responsiveness during the London session. |
| BB Std Dev Multiplier | 2.0 | Standard deviation multiplier for band width. 2 captures roughly 95% of price action. I tighten to 1.8 for Bitcoin to catch more reversals, and widen to 2.2 for ES futures to avoid false squeezes. |
| Source | Close | Price source for calculations. Close is standard. I use HLC3 on lower timeframes (1m-5m) to reduce noise in the band placement. |
| Squeeze Lookback | 20 | Bars to compare current band width against for squeeze detection. Higher values (50+) reduce squeeze signals to only major compressions. I keep 20 for day trading across ES and BTC. |
Bollinger Bands + Pineify Invite-Only: Better Together
Bollinger Bands alone gives you one signal type. Pineify invite-only indicator combines Bollinger Bands with RSI divergences, MACD confirmation, and Supertrend filters in one overlay. Fewer charts, clearer signals.
Instead of switching between 6 different signals on separate charts, you get a single multi-confirmation setup.
See the Invite-Only IndicatorRelated Resources
FAQ
Bollinger Bands Signals FAQ
Stop juggling Bollinger Bands with 4 other charts
Pineify combines Bollinger Bands, RSI, MACD, and Supertrend into one invite-only indicator. One click setup.
Try Pineify Free