Bollinger Bands Breakout Strategy

Build a volatility-based breakout strategy using Bollinger Bands. This tutorial teaches you to identify and trade explosive price moves when volatility contracts and then expands.

What You'll Build

A breakout strategy that identifies low-volatility periods (bands squeezing) and enters when price breaks out of the bands with volume confirmation. Captures explosive moves after consolidation.

Time Required: 20-25 minutes

Strategy Overview

Strategy Type

Breakout/Volatility - profits from explosive moves after periods of low volatility.

Indicator

Bollinger Bands - measures volatility and identifies potential breakout zones.

Entry Logic

Buy when price closes above upper band after band squeeze (low volatility period).

Exit Logic

Sell when price returns to middle band (SMA) or exits below lower band.

Understanding Bollinger Bands

Bollinger Bands Components

Middle Band (SMA): 20-period simple moving average. Represents the "average" price.
Upper Band: SMA + (2 × Standard Deviation). Represents overbought zone.
Lower Band: SMA - (2 × Standard Deviation). Represents oversold zone.
Bandwidth: Distance between upper and lower bands. Measures volatility.

The Squeeze: When bands narrow (low bandwidth), volatility is contracting. This often precedes explosive moves. Price breakouts from squeezes can be very profitable.

Step 1: Add Bollinger Bands to a Data Source

Single Feature, Multiple Columns. Bollinger Bands is a single feature with canonical name bollinger:p=20:mult=2. It exposes three sub-columns you reference in a Data Source node:

  • bb_upper — upper band (SMA + 2 × std dev)
  • bb_sma — middle band (20-period SMA)
  • bb_lower — lower band (SMA − 2 × std dev)

Bandwidth (upper − lower) is not a separate feature — compute it with a Math node: connect bb_upper and bb_lower outputs and subtract them. To compare current bandwidth with a value from 5 bars ago, add column bb_upper:lag=5 and bb_lower:lag=5 in the same Data Source node and compute bandwidth-5-bars-ago with another Math node.

1

Configure the Data Source Node

  1. Drag a Data Source node onto the canvas
  2. Add columns: close, bb_upper, bb_sma, bb_lower
  3. To detect band expansion, also add bb_upper:lag=5 and bb_lower:lag=5
  4. Use Math nodes to compute current bandwidth (bb_upper − bb_lower) and historical bandwidth 5 bars ago

Step 2: Build Strategy Logic

2

Breakout Strategy Canvas

  1. Create strategy: "Bollinger Breakout"
  2. Build entry condition (upward breakout with band expansion):
    Buy Signal:
    Condition node: close > bb_upper (price closes above upper band)
    Math node: compute current bandwidth = bb_upper − bb_lower
    Math node: compute historical bandwidth = bb_upper:lag=5 − bb_lower:lag=5
    Condition node: current bandwidth > historical bandwidth (bands expanding)
    Logic (AND) node: both conditions must be true
    Action node set to BUY; connect the AND output to it
  3. Build exit condition:
    Sell Signal:
    Condition node: close < bb_sma (close falls below middle band)
    Action node set to SELL; connect the Condition output to it
  4. Save the strategy (validation runs automatically as you build)

Step 3: Backtest Configuration

Recommended Settings

  • Symbol: Volatile pairs (BTCUSDT, ETHUSDT, SOLUSDT)
  • Timeframe: 1h or 4h (good balance for breakouts)
  • Period: 6-12 months
  • Position Size: 80% (leave buffer for volatility)

Why volatile assets? Breakout strategies need price movement. Low-volatility assets rarely produce squeezes and breakouts. Crypto pairs work well due to natural volatility.

Expected Performance

Target Metrics

Total Return (6mo)

25-50%

Sharpe Ratio

1.0-1.8

Max Drawdown

18-28%

Win Rate

45-55%

Trades (6mo)

20-40

Avg Win/Loss

1.3-2.0

Strategy Enhancements

Volume Confirmation

Only take breakouts when volume is above 1.5x average. High volume confirms genuine breakouts vs. false moves.

Squeeze Detection

Measure bandwidth over rolling 20-bar window. Only trade when current bandwidth is in lowest 20th percentile (tight squeeze).

ATR Stop Loss

Set stop loss at 2× ATR below entry. Adapts to current volatility and reduces premature exits.

Profit Target

Take profit when price reaches 1.5-2× the bandwidth above entry. Locks in gains from explosive moves.

Completion Checklist

  • ✓ Configured a Data Source node with bb_upper, bb_sma, bb_lower and :lag=5 variants
  • ✓ Built breakout logic with Math nodes for bandwidth and Condition + Logic (AND) nodes
  • ✓ Backtested on volatile assets with good results
  • ✓ Understand when breakouts work (after low volatility periods)
  • ✓ Deployed to paper trading and monitoring performance

What's Next?