Bollinger Bands: Mean Reversion or Breakout? The Two Rules a Backtest Must Keep Apart

8 min readQuantParadox research

The same indicator is sold as a reversal tool and as a breakout tool, and both camps have charts to prove it. That is possible because the bands describe volatility, not direction, and which rule works depends on a regime the bands themselves can help identify.

The short answer

Bollinger Bands are a volatility envelope around a moving average, and a Bollinger Band trading strategy is either a mean-reversion rule that fades a touch of the band or a breakout rule that follows a close beyond it, so a backtest must state which rule it is grading.

What do Bollinger Bands measure?

Bollinger Bands are a moving average with an upper and lower band placed a stated number of standard deviations of price away from it, so their width measures recent volatility and a touch of a band means price is at an unusual distance from its recent average.

The default is a twenty-period average with bands at two standard deviations. In a stable distribution, price would spend most of its time inside such bands and touch them rarely. Price is not stably distributed, so the touches are more frequent than the arithmetic suggests and cluster in trends, which is the whole reason two opposite strategies can both claim the indicator.

The width of the bands carries information of its own. When it contracts, volatility has fallen and a period of expansion tends to follow; when it expands, a move is under way. Neither says anything about direction.

Everything a Bollinger rule does is therefore conditional on what kind of market it is in, and a rule that does not know which kind is betting on the mix.

Why can't both rules be right at once?

Both rules cannot be right at once because they take opposite positions at the same moment: a touch of the upper band is a sell for the reversion rule and, if price closes beyond it, a buy for the breakout rule, and on any given bar only one of them is on the right side.

What resolves the contradiction is regime. In a ranging market, price that reaches a band tends to return toward the average, and the reversion rule wins. In a trending market, price rides the band for extended periods, each touch is followed by another, and the breakout rule wins while the reversion rule bleeds. The bands do not know which regime they are in; the trader has to.

Band width is the usual regime signal. A contraction, sometimes called a squeeze, suggests a breakout is more likely than reversion, because the compressed volatility has to resolve. Wide bands after a sustained move suggest the opposite. A rule that uses width to choose between its two modes is a third strategy, and it has an extra parameter, the width threshold.

Pooling the two rules into one test, or testing one rule on a history whose regime mix happened to favour it, produces a result that describes the history rather than the rule.

How do you test the reversion rule?

The reversion rule enters against a touch of a band with a target at the middle average and a stop beyond the band, and the test has to fix what counts as a touch, how the stop is placed, and what happens when price rides the band instead of returning.

A touch can be a wick reaching the band or a close beyond it. The wick version fires more often and catches more genuine extremes; the close version waits for confirmation and enters later at a worse price. The stop beyond the band is a small distance in a quiet market and a large one in an active one, which is why grading in volatility-scaled units matters.

The band ride is the failure case and it decides the result. In a trend, price can touch the upper band on bar after bar, and the reversion rule that sells each touch takes a series of losses. Whether the wins in ranges outweigh those losses is the finding, and it depends on the regime mix of the history and on any filter that keeps the rule out of trends.

The natural filter is a trend measure from a higher timeframe or a band-width condition, and the filtered and unfiltered results should both be shown with their trade counts.

How do you test the breakout rule?

The breakout rule enters in the direction of a close beyond a band, often only after a contraction of the bands, with a stop back inside the bands or at the middle average, and the test has to fix the contraction threshold, the break confirmation and the exit.

The contraction threshold is the parameter that does most of the work. A rule that takes every close beyond a band is entering at the extremes the reversion rule fades, and it loses in ranges for the mirror-image reason. A rule that requires the bands to have narrowed to a stated fraction of their recent width first is selecting the breaks that follow compression, which is a smaller and more specific set.

The exit is where breakout rules differ most. A fixed target in volatility units, a trailing stop along the opposite band, and an exit on the first close back inside the bands are three different rules with different profiles. The trailing version captures long trends and gives back a large fraction of each; the fixed version captures less and gives back less.

As with the reversion rule, the failure case is the regime the rule was not built for, and the honest result shows how it did across both.

How does QuantParadox handle the bands?

QuantParadox exposes the upper band, lower band, middle average and band width as separate values, on the entry timeframe or a higher one as of the last completed bar, so the reversion rule, the breakout rule and a width-conditioned version of either are each a few conditions.

The width value is what makes the squeeze condition expressible without a separate indicator, and a volatility rank across recent history is available for rules that want to state the contraction relative to the instrument's own range rather than as a fixed number.

The limitation is that the bands are computed with a population standard deviation over the stated period, and platforms differ on that detail and on how the average is seeded. A rule ported from a charting package should be compared on a sample of bars before its results are trusted across platforms.

Both rules are trend-conditional, and the Reconciliation view's split by conditions at entry is the natural way to see which regime carried each result. A reversion rule that made all of its money in ranges and lost it in trends is a finding, and it is a different finding from a rule that has no edge.

Questions people actually ask

Are Bollinger Bands better for mean reversion or breakouts?

Neither in general, because the bands measure volatility rather than direction and the two rules win in opposite regimes. Reversion tends to work when the market is ranging and price returns to the average after reaching a band; breakouts tend to work after a contraction of the bands resolves into a trend. A test that grades each rule separately, split by regime and with trade counts, shows which one a specific market and period favoured, and a rule that uses band width to choose between them is a third strategy with its own result.

What settings should Bollinger Bands use?

The twenty-period, two-standard-deviation default is a convention rather than a finding. A shorter period tracks price more closely and produces more touches; a wider deviation produces fewer. As with any indicator, the useful procedure is to map the result across a range of both settings, prefer a broad region of similar results over a single best cell, and confirm the choice on history that was not used to draw the map.

What is a Bollinger Band squeeze?

A squeeze is a contraction of the bands to a narrow width relative to their recent history, which reflects a fall in volatility and is read as a sign that an expansion is likely to follow. It says nothing about the direction of that expansion, so a squeeze rule waits for a close beyond a band to choose a side. The width threshold that defines a squeeze is a parameter, and it should be stated in relative terms and examined for stability rather than fixed at a number that happened to work.

The only backtest that settles it is yours.

Build a strategy from a sentence, paste your own Python, or import your live trade history and have it graded. Five full backtests free, no card, and we'll tell you plainly when the result is indistinguishable from luck.

We publish research and tooling, not trading advice, and we make no claim about future returns. Everything above describes how to test an idea — not a reason to trade one.