🔥Black Friday Sale: Get 25% OFF Premium with code BLACKFRIDAY — Sale ends December 1st!🎉
Bollinger Bands Strategy — 5 Profitable Ways to Trade BB Squeezes and Bounces

Bollinger Bands Strategy — 5 Profitable Ways to Trade BB Squeezes and Bounces

By HorizonAI Team

Bollinger Bands are one of the most versatile technical indicators in trading. They adapt to market volatility, identify overbought/oversold conditions, and signal explosive breakouts—all at the same time.

But most traders only use them one way (the bounce). This guide reveals five proven Bollinger Bands strategies that work across stocks, forex, and crypto, with complete code examples you can use today.

What are Bollinger Bands?

Bollinger Bands consist of three lines:

  1. Middle Band: 20-period Simple Moving Average (SMA)
  2. Upper Band: Middle + (2 × Standard Deviation)
  3. Lower Band: Middle - (2 × Standard Deviation)

Key insight: The bands expand during high volatility and contract during low volatility. This creates two types of opportunities:

  • Mean Reversion: Price bounces off bands back to the middle
  • Breakouts: Price breaks through bands during volatility expansion

Default settings: 20-period SMA, 2 standard deviations (used in all examples below)

Strategy #1: Bollinger Band Bounce (Mean Reversion)

Best for: Range-bound markets, oversold/overbought conditions

Logic:

  • Price hits lower band = oversold → buy
  • Price hits upper band = overbought → sell (or take profit)

Entry rules:

  • Buy when price touches or crosses below lower band
  • Confirm with RSI < 30 (optional but recommended)

Exit rules:

  • Take profit at middle band
  • Or exit when price touches upper band

Pine Script: BB Bounce Strategy

//@version=5
strategy("BB Bounce Strategy", overlay=true)

// Bollinger Bands
length = input.int(20, "BB Length")
mult = input.float(2.0, "BB Std Dev")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upperBand = basis + dev
lowerBand = basis - dev

// RSI confirmation
rsiLength = input.int(14, "RSI Length")
rsiValue = ta.rsi(close, rsiLength)

// Plot Bollinger Bands
plot(basis, "Middle Band", color.blue)
p1 = plot(upperBand, "Upper Band", color.red)
p2 = plot(lowerBand, "Lower Band", color.green)
fill(p1, p2, color.new(color.blue, 95))

// Entry: Price touches lower band + RSI oversold
longCondition = close &lt;= lowerBand and rsiValue &lt; 30

if longCondition and barstate.isconfirmed
    strategy.entry("Long", strategy.long)

// Exit: Price reaches middle band
if close &gt;= basis and strategy.position_size &gt; 0
    strategy.close("Long", comment="Target Hit")

// Visualization
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, 
          color=color.green, size=size.small)

Best markets: SPY, QQQ, major forex pairs during sideways periods

Win rate: 60-70% in ranging markets
Risk-Reward: Typically 1:1 to 1:2 (lower band to middle/upper band)

Strategy #2: Bollinger Band Squeeze (Breakout)

Best for: Anticipating explosive moves after low volatility

The Squeeze: When Bollinger Bands contract to their narrowest width, it signals low volatility. This is often followed by a violent breakout (up or down).

How to identify:

  • Bollinger Band width at multi-week lows
  • Price consolidating inside narrow bands
  • Volume decreasing (coiling energy)

Entry rules:

  • Wait for squeeze (narrow bands)
  • Enter when price breaks above upper band (bullish) or below lower band (bearish)
  • Confirm with volume spike

Exit rules:

  • Trail stop using middle band
  • Or exit when bands start contracting again

Pine Script: BB Squeeze Breakout

//@version=5
strategy("BB Squeeze Breakout", overlay=true)

// Bollinger Bands
length = input.int(20, "BB Length")
mult = input.float(2.0, "BB Multiplier")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upperBand = basis + dev
lowerBand = basis - dev

// Calculate band width (measure of volatility)
bandWidth = (upperBand - lowerBand) / basis

// Identify squeeze: band width at 20-bar low
squeezeLookback = input.int(20, "Squeeze Lookback")
isSqueeze = bandWidth == ta.lowest(bandWidth, squeezeLookback)

// Volume confirmation
avgVolume = ta.sma(volume, 20)
volumeSpike = volume &gt; avgVolume * 1.5

// Entry conditions
bullishBreakout = close &gt; upperBand and volumeSpike and isSqueeze[1]
bearishBreakout = close &lt; lowerBand and volumeSpike and isSqueeze[1]

if bullishBreakout and barstate.isconfirmed
    strategy.entry("Long", strategy.long)

if bearishBreakout and barstate.isconfirmed
    strategy.entry("Short", strategy.short)

// Exit: price crosses back to middle band
if ta.cross(close, basis)
    strategy.close_all(comment="Mean Reversion")

// Visualization
plot(basis, "Basis", color.blue)
plot(upperBand, "Upper", color.red)
plot(lowerBand, "Lower", color.green)
bgcolor(isSqueeze ? color.new(color.yellow, 90) : na, title="Squeeze")
plotshape(bullishBreakout, style=shape.triangleup, location=location.belowbar, 
          color=color.green, size=size.normal)
plotshape(bearishBreakout, style=shape.triangledown, location=location.abovebar, 
          color=color.red, size=size.normal)

Best markets: Crypto (BTC, ETH), volatile stocks (TSLA, NVDA)

Win rate: 40-50% (but RR is often 3:1 or better)
Risk-Reward: 3:1+ (squeeze breakouts move far)

Strategy #3: Bollinger Band Walk (Trend Riding)

Best for: Strong trending markets

The Walk: In strong trends, price "walks the band"—repeatedly touching the upper band (uptrend) or lower band (downtrend) without reverting to the middle.

Key insight: When price walks the upper band, it's not "overbought"—it's strong. Don't fade it; ride it.

Entry rules:

  • Price must be above 50 SMA (bullish bias)
  • Enter when price pulls back to middle band
  • Confirm price bounces back toward upper band

Exit rules:

  • Exit when price crosses below middle band
  • Or use trailing stop

Pine Script: BB Walk Trend Following

//@version=5
strategy("BB Walk Strategy", overlay=true)

// Bollinger Bands
length = input.int(20, "BB Length")
mult = input.float(2.0, "BB Multiplier")
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upperBand = basis + dev
lowerBand = basis - dev

// Trend filter
sma50 = ta.sma(close, 50)
inUptrend = close &gt; sma50

// Detect "walk" - price touched upper band recently
touchedUpper = ta.highest(high, 5) &gt;= upperBand[1]

// Entry: pullback to middle band in uptrend after walking upper band
longCondition = inUptrend and touchedUpper and ta.crossover(close, basis)

if longCondition and barstate.isconfirmed
    strategy.entry("Long", strategy.long)

// Exit: price crosses below middle band (trend weakening)
if ta.crossunder(close, basis) and strategy.position_size &gt; 0
    strategy.close("Long", comment="Trend Break")

// Visualization
plot(basis, "Basis", color.blue, 2)
plot(upperBand, "Upper", color.red)
plot(lowerBand, "Lower", color.green)
plot(sma50, "50 SMA", color.orange, 2)
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green)

Best markets: Strong trending assets (tech stocks in bull markets, BTC uptrends)

Win rate: 50-60%
Risk-Reward: 2:1 to 5:1 (rides trend until exhaustion)

Strategy #4: Double Bollinger Bands (High Probability)

Best for: Filtering false signals

The concept: Use two sets of Bollinger Bands:

  • Inner Bands: 1 standard deviation (conservative)
  • Outer Bands: 2 standard deviations (traditional)

Entry rules:

  • Only buy when price hits outer band (2 std dev)
  • Take profit at inner band (1 std dev) for quick wins
  • Or hold for middle band for bigger gains

Why it works: Price hitting 2 std dev bands is more extreme (higher probability of reversion).

Pine Script: Double Bollinger Bands

//@version=5
strategy("Double BB Strategy", overlay=true)

// Bollinger Bands - Outer (2 std dev)
length = input.int(20, "BB Length")
basis = ta.sma(close, length)
dev2 = 2.0 * ta.stdev(close, length)
upperBand2 = basis + dev2
lowerBand2 = basis - dev2

// Inner Bands (1 std dev)
dev1 = 1.0 * ta.stdev(close, length)
upperBand1 = basis + dev1
lowerBand1 = basis - dev1

// Plot bands
plot(basis, "Middle", color.blue, 2)
plot(upperBand2, "Upper 2σ", color.red)
plot(lowerBand2, "Lower 2σ", color.green)
plot(upperBand1, "Upper 1σ", color.orange, 1, plot.style_circles)
plot(lowerBand1, "Lower 1σ", color.teal, 1, plot.style_circles)

// Entry: price hits lower 2σ band (extreme)
longCondition = close &lt;= lowerBand2

if longCondition and barstate.isconfirmed
    strategy.entry("Long", strategy.long)

// Exit 1: Quick profit at inner band (1σ)
if close &gt;= lowerBand1 and strategy.position_size &gt; 0
    strategy.close("Long", qty_percent=50, comment="Target 1")

// Exit 2: Full profit at middle band
if close &gt;= basis and strategy.position_size &gt; 0
    strategy.close("Long", comment="Target 2")

plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green)

Best markets: Any (very versatile)

Win rate: 70-80% (high probability setups)
Risk-Reward: 1:1 at inner band, 2:1 at middle band

Strategy #5: Bollinger Bands + RSI Combo

Best for: Filtering false breakouts and improving entries

The problem with BB alone: Price touching lower band doesn't guarantee a bounce—it could keep falling.

The solution: Combine BB with RSI to confirm oversold/overbought conditions.

Entry rules:

  • Price touches lower BB AND RSI < 30 (double confirmation)
  • Price touches upper BB AND RSI > 70 (overbought)

Exit rules:

  • Exit when RSI crosses back above 50 (from oversold)
  • Or when price reaches middle band

Pine Script: BB + RSI Combo

//@version=5
strategy("BB + RSI Strategy", overlay=true)

// Bollinger Bands
bbLength = input.int(20, "BB Length")
bbMult = input.float(2.0, "BB Multiplier")
basis = ta.sma(close, bbLength)
dev = bbMult * ta.stdev(close, bbLength)
upperBand = basis + dev
lowerBand = basis - dev

// RSI
rsiLength = input.int(14, "RSI Length")
rsiValue = ta.rsi(close, rsiLength)
rsiOversold = input.int(30, "RSI Oversold Level")
rsiOverbought = input.int(70, "RSI Overbought Level")

// Entry: Double confirmation
longCondition = (close &lt;= lowerBand) and (rsiValue &lt; rsiOversold)
shortCondition = (close &gt;= upperBand) and (rsiValue &gt; rsiOverbought)

if longCondition and barstate.isconfirmed
    strategy.entry("Long", strategy.long)

if shortCondition and barstate.isconfirmed
    strategy.entry("Short", strategy.short)

// Exit when RSI crosses back to neutral zone
longExit = ta.crossover(rsiValue, 50)
shortExit = ta.crossunder(rsiValue, 50)

if longExit and strategy.position_size &gt; 0
    strategy.close("Long", comment="RSI Neutral")

if shortExit and strategy.position_size &lt; 0
    strategy.close("Short", comment="RSI Neutral")

// Visualization
plot(basis, "Basis", color.blue)
plot(upperBand, "Upper", color.red)
plot(lowerBand, "Lower", color.green)
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green)
plotshape(shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red)

// RSI in separate pane would be ideal, but this shows on-chart signals

Best markets: Choppy/ranging markets (forex pairs, SPY during consolidation)

Win rate: 65-75%
Risk-Reward: 1.5:1 to 2:1

Which Bollinger Bands Strategy Should You Use?

Market ConditionBest StrategyWin RateRR
Sideways/RangingBB Bounce (#1) or BB + RSI (#5)65-75%1:1 to 2:1
Low VolatilityBB Squeeze (#2)40-50%3:1+
Strong TrendBB Walk (#3)50-60%2:1 to 5:1
Choppy MarketsDouble BB (#4) or BB + RSI (#5)70-80%1:1 to 2:1
Any ConditionDouble BB (#4)70-80%1:1 to 2:1

Pro tip: Use multiple strategies based on market conditions. Start each trading session by identifying: Is the market trending, ranging, or squeezing?

Common Bollinger Bands Mistakes to Avoid

Don't short just because price hit the upper band in a strong uptrend. Check if price is "walking the band."

❌ Mistake #2: Ignoring Volume

BB breakouts without volume are often false. Always confirm with volume spike.

❌ Mistake #3: Using Default Settings Blindly

20-period, 2 std dev works for daily charts. For intraday:

  • 5-minute charts: Try 50-period BB
  • 1-hour charts: 20-period is fine

❌ Mistake #4: No Stop Loss

Even mean reversion strategies fail. Always use stops:

  • For bounces: Stop 5-10% beyond the band
  • For breakouts: Stop at middle band

❌ Mistake #5: Forgetting Market Regime

BB bounce works in ranges. BB breakout works after squeezes. Don't mix them up.

Advanced Tips from Pro Traders

1. Combine BB with Moving Averages

Only take BB bounce longs if price is above 200 SMA (bullish regime).

2. Use Multiple Timeframes

Check BB on higher timeframe:

  • If daily BB shows squeeze, 1-hour breakouts are more powerful
  • If daily BB shows uptrend, take 1-hour long bounces only

3. Adapt Standard Deviation Settings

  • Crypto: Use 2.5 or 3 std dev (higher volatility)
  • Forex majors: 2 std dev (standard)
  • Low volatility stocks: 1.5 std dev

4. Watch for "M" and "W" Patterns

  • Double Top (M): Price hits upper band twice = reversal signal
  • Double Bottom (W): Price hits lower band twice = bounce signal

Generate BB Strategies Instantly with HorizonAI

Instead of coding all these variations manually, use HorizonAI to generate custom Bollinger Bands strategies.

Example prompts:

"Create a BB squeeze breakout strategy with volume confirmation and ATR-based stops"

"Build a double Bollinger Bands mean reversion strategy with RSI filter for 15-minute charts"

"Generate a BB walk trend-following system with 50 SMA filter and trailing stops"

HorizonAI generates clean, optimized Pine Script with:

  • ✅ Proper band calculations
  • ✅ Volume filters
  • ✅ Risk management built-in
  • ✅ Multi-timeframe logic
Create your BB strategy now →

Backtesting Checklist for BB Strategies

Before going live, verify:

  • ✅ Tested on at least 1 year of data
  • ✅ Works across multiple symbols
  • ✅ Includes realistic commissions (0.1%+)
  • ✅ Win rate and RR match expectations
  • ✅ Max drawdown is acceptable (<20%)
  • ✅ Performance consistent across market regimes

Final Thoughts

Bollinger Bands are powerful because they adapt to market conditions automatically. But they're not magic—you need to:

  1. Match the strategy to market conditions (squeeze vs bounce vs walk)
  2. Use confirmation indicators (RSI, volume, trend filters)
  3. Manage risk (stops, position sizing, max open trades)
  4. Backtest thoroughly (don't trust default settings blindly)

Start with one strategy (we recommend #4 Double BB for beginners), paper trade it for a month, then expand to others.

Have questions about Bollinger Bands strategies? Join our Discord to share results and discuss with active traders!