Indicators
Bollinger Bands Strategy Guide for Trading Bots
How Bollinger Bands measure volatility, the difference between mean-reversion and breakout uses, and how to automate a Bollinger strategy in Setup.Cash.
Featured image placeholder
/og/setup-cash-og.svg
Bollinger Bands wrap a moving average in two bands set a number of standard deviations away. They visualize volatility: the bands widen when the market is volatile and contract when it is calm.
The Three Lines
- Middle band: a moving average (default 20).
- Upper band: middle + (2 × standard deviation).
- Lower band: middle − (2 × standard deviation).
Roughly 95% of price action stays inside 2-standard-deviation bands, which is why touches of the bands draw attention.
Two Opposite Uses
1. Mean reversion. In a range, price tends to revert from the bands to the middle. Buy near the lower band, sell/exit near the middle or upper band. Works in sideways markets; dangerous in trends.
2. Breakout (squeeze). When the bands contract sharply (a "squeeze"), volatility is low and a big move often follows. Trade the breakout when price closes outside the bands after a squeeze.
Knowing which regime you are in is everything — the same band touch means "buy the dip" in a range and "trend is accelerating" in a breakout.
Building It in Setup.Cash
Add the Bollinger Bands indicator in the builder, with inputs for length and standard deviation. Then:
- Mean reversion: long when price touches the lower band and turns up.
- Breakout: long when price closes above the upper band after a low-volatility period.
Or describe it to text-to-strategy: "Bollinger breakout on BTCUSD 1h after a squeeze, ATR stop, trail the winner."
Combine With a Trend Filter
Bollinger mean reversion is much safer with a higher-timeframe trend filter: only fade the lower band when the bigger trend is neutral or up. In a strong downtrend, "oversold" band touches keep getting more oversold.
Tuning
- Length 20, 2 SD: the classic default.
- Tighter SD (1.5): more signals, more noise.
- Wider SD (2.5–3): only extreme moves trigger.
Build a Custom Variant
In the Indicators Lab you can build a custom band system — for example, bands plus a squeeze-detection event you can wire straight into entries. Generate it with AI or write it in the formula language.
As always, backtest the strategy across multiple periods and confirm with paper trading before going live. Bollinger Bands describe volatility — they do not predict direction on their own.
Related Posts
View allIndicators
ADX and DI Explained: Measuring Trend Strength
How the Average Directional Index measures trend strength, how +DI and −DI show direction, and how to use ADX as a regime filter in Setup.Cash.
2 min read · 291 words
Indicators
ATR Indicator Explained: Measuring Market Volatility
What Average True Range measures, why it is the backbone of volatility-aware stops and position sizing, and how to use ATR in a Setup.Cash strategy.
2 min read · 356 words
Indicators
CCI (Commodity Channel Index) Explained
How the Commodity Channel Index measures price deviation from its average, how to read the ±100 levels, and how to automate CCI in Setup.Cash.
2 min read · 268 words
Indicators
Ichimoku Cloud Explained for Automated Trading
Understand the five Ichimoku lines, how the cloud (Kumo) defines trend and support/resistance, and how to automate Ichimoku signals in Setup.Cash.
2 min read · 381 words
Start here
Build your trading bot workflow with structure
Use Setup.Cash to create, backtest, and paper trade rule-based strategies without relying on guesswork. Not financial advice. Trading involves risk.