Bollinger Bands Strategy: A Complete Guide with Examples

Huzefa Kudrati Updated Oct 3, 2026 9 min read

Bollinger Bands Strategy: A Complete Guide with Examples

A Bollinger Bands strategy uses three lines around price: a 20-period moving average in the middle and bands two standard deviations above and below it. Traders use the bands in three main ways: buying near the lower band in a range (mean reversion), trading the breakout after the bands squeeze tight, and riding a trend while price "walks" along a band.

Illustration of Bollinger Bands as riverbanks around price

What are Bollinger Bands?

Bollinger Bands were developed by John Bollinger in the 1980s as a way to measure whether prices are high or low relative to their own recent volatility. They have three lines:

Line Calculation (default) What it tells you
Middle band 20-period simple moving average (SMA) The recent average price, the trend baseline
Upper band Middle band + 2 × standard deviation Where price is high relative to recent volatility
Lower band Middle band − 2 × standard deviation Where price is low relative to recent volatility

Because the bands are built from the standard deviation of price, they widen when price swings more and narrow when it calms down.

Daily candlestick chart with Bollinger Bands shaded around price, widening in volatile stretches and narrowing in quiet onesBollinger Bands expand and contract with volatility

The Bollinger Bands formula, worked out

  1. Middle band: add the last 20 closes and divide by 20.
  2. Standard deviation: for each of the 20 closes, take its distance from the middle band, square it, average those squares, and take the square root.
  3. Upper band: middle band + 2 × standard deviation.
  4. Lower band: middle band − 2 × standard deviation.

Two related measures are useful in rules:

  • %b = (close − lower band) ÷ (upper band − lower band). It is 1 at the upper band, 0 at the lower band and 0.5 at the middle. In the example, a close of 103 gives %b = (103 − 99.17) ÷ 5.66 ≈ 0.68.
  • Bandwidth = (upper band − lower band) ÷ middle band. In the example, 5.66 ÷ 102 ≈ 0.055. A low reading compared with its own history is a squeeze.

Three Bollinger Bands strategies

1. Mean reversion: buy near the lower band in a range

When a stock is moving sideways, a close at or below the lower band means price is stretched to the downside relative to its recent behaviour. The trade is a bounce back toward the middle band.

  • Entry: close below the lower band, then the next candle closes back inside the bands.
  • Target: the middle band.
  • Stop: below the low of the signal candle.
  • Filter: only take it when the bands are roughly flat. In a downtrend, price can keep closing below the lower band.

2. The squeeze breakout

When bandwidth falls to its lowest level in months, volatility is compressed. Compression doesn't tell you the direction, but it often comes before an expansion.

  • Setup: bandwidth at a multi-month low.
  • Entry: a close outside the upper band (long) or lower band (short).
  • Exit: a close back inside the middle band, or a trailing stop.

3. The band walk: trend following

In a strong uptrend, price can close at or above the upper band again and again. Selling every upper-band touch fights the trend; a band walk strategy joins it instead. The Tradetron example strategy below is of this type.

Example: a Bollinger Bands strategy on Tradetron

This intraday stock strategy is built in Tradetron's no-code builder, and you can duplicate it. It buys strength: two consecutive green 15-minute candles that open and close above the upper band.

Entry conditions

In Tradetron, Position picks a candle from a series: position −1 is the last completed candle and −2 the one before it. Every entry condition is joined with AND, so all must be true together.

Tradetron condition builder with AND conditions: close above open and close and open above the Upper Bollinger band for the candle at position -2Entry conditions for the candle before last (position -2)

Tradetron condition builder: the last candle (position -1) closes above its open and opens above the Upper Bollinger bandEntry conditions for the last completed candle (position -1)

Exit conditions

The exit is joined with OR, so any one of them closes the trade: the last close falls back below the upper band, LTP rises above the entry price × 1.1 (10% target), or LTP falls below the entry price × 0.9 (10% stop).

Tradetron condition builder with OR: close below the Upper Bollinger band, or LTP above EntryPrice × 1.1, or LTP below EntryPrice × 0.9Exit conditions joined with OR

Choosing settings and timeframe

Trading style Typical timeframe Notes
Intraday 5- or 15-minute candles More signals; more noise and costs
Swing Hourly or daily Fewer, cleaner signals; overnight risk
Positional Daily or weekly Best for squeeze setups that build over weeks

The defaults (20, 2) work across timeframes. Some traders use a shorter period with narrower bands for faster signals, or a longer period with wider bands for fewer. Whatever you choose, backtest it rather than picking what looks best on one chart.

Pros

  • Adapts to each stock's volatility automatically
  • One indicator supports reversal, breakout and trend setups
  • Clear, rule-friendly levels that are easy to automate
  • Squeeze readings flag quiet periods before larger moves

Cons

  • Band touches are not signals on their own; context decides
  • Mean-reversion rules lose money in strong trends
  • Breakout rules lose money in ranges
  • Lagging, because it is built on a moving average

Combining Bollinger Bands with other indicators

Bollinger Bands describe where price is relative to its volatility, so they pair well with tools that describe something else:

  • RSI to confirm a mean-reversion setup is genuinely oversold or overbought.
  • A longer moving average (say 200-period) to decide whether you should only take longs or only shorts.
  • Volume to check that a squeeze breakout has real participation.

Our guide to the best indicators for options trading covers several of these.

Other trend tools worth reading about: Renko charts and the double Supertrend strategy.

Frequently asked questions

What is the best Bollinger Bands strategy?

There isn't one best setup; it depends on the market. Mean reversion to the middle band works best in sideways markets, squeeze breakouts suit quiet markets about to move, and band walks suit strong trends. Whichever you pick, add a stop loss and test it on past data.

What is the formula for Bollinger Bands?

Middle band = 20-period simple moving average of closing prices. Upper band = middle band + 2 × the standard deviation of those 20 closes. Lower band = middle band − 2 × that standard deviation. %b = (close − lower band) ÷ (upper band − lower band).

What is the best timeframe for Bollinger Bands?

Day traders often use 5- or 15-minute charts; swing and positional traders use hourly, daily or weekly charts. The default (20, 2) setting works on all of them, but signals behave differently, so backtest on the timeframe you trade.

What does a Bollinger Band squeeze mean?

A squeeze is when the bands come unusually close together, meaning volatility is low. It often comes before a larger move, but it doesn't say which direction. Traders wait for a close outside the bands to pick a side.

Is it a sell signal when price touches the upper band?

Not by itself. In a range, an upper-band touch can mark a short-term top. In a strong uptrend, price can keep touching or closing above the upper band. Check the trend before treating a touch as a signal.

Is Bollinger Bands a good indicator?

It is a useful volatility indicator and one of the most widely used. It works best combined with a trend filter or a momentum indicator such as RSI, and with clear exit rules.

Can I automate a Bollinger Bands strategy?

Yes. On Tradetron, the Upper Bolinger, Lower Bolinger and Bolinger Band width keywords let you write band conditions without code, apply them to a list of stocks, backtest them, and run them Live Offline before trading real money.

Want to join Tradetron?

Thousands of traders have moved to algo trading. Leave your number and our team will help you get started.