Bollinger Bands place an upper and lower volatility envelope around a moving average. They describe a price relative to a recent window; a touch does not say what price will do next. The same band can frame a continuation hypothesis or a return-toward-the-middle hypothesis, so write the rule before testing either one.

Calculate the bands you intend to use

For a simple moving-average version, write the basis as the mean of the chosen price series over a fixed length. The upper band is the basis plus a chosen multiple of the standard deviation; the lower band subtracts that same distance. Name the price input, average type, lookback, deviation convention, multiplier, and whether the active bar is included. “Twenty and two” are conventional defaults, not a universal optimum.

Here is a fictional five-close calculation using closes 98, 99, 100, 101 and 102 and the population standard deviation for this example. The simple average is 100. Deviations from the mean are −2, −1, 0, 1 and 2, so the mean squared deviation is (4 + 1 + 0 + 1 + 4) ÷ 5 = 2. The standard deviation is √2, about 1.414. With a multiplier of 2, the illustrative bands are 100 ± 2.828: lower 97.17 and upper 102.83. The latest close at 102 is near the upper band, but remains inside it. That observation alone defines no order.

Bollinger snapshot calculation and separate strategy hypothesesA number line shows five fictional closes from one window inside that window's calculated lower and upper band; the band values are a single-window summary, not a historical band series. A separate panel shows the reproducible calculation and two independent test ideas.ONE FIVE-CLOSE WINDOW · A SNAPSHOT, NOT A HISTORICAL BAND PLOTPrice level within the example window9899100101102 · lastLower 97.17Basis 100Upper 102.83SMA = 100 · population σ = √2Band = mean ± 2σ100 ± 2.828 = 102.83 / 97.17Close 102 is inside this window's bands;that observation alone defines no order.Reversion testdefine return trigger · exit · invalidationContinuation testdefine later entry · failure · exposureThe example is fictional · evaluate the two strategy hypotheses separately
A number line shows five fictional closes from one window inside that window's calculated lower and upper band; the band values are a single-window summary, not a historical band series. A separate panel shows the reproducible calculation and two independent test ideas. Illustrative teaching graphic · not live market data

Platforms can differ in basis type, source, offset and warm-up behavior. TradingView documents its adjustable Bollinger inputs and the common SMA-plus-or-minus-two-standard-deviations setup. Recalculate a few rows by hand and compare values before assuming a separate implementation matches it. If the window is incomplete, retain a missing value instead of filling it with zero.

Read band position and width as measurements

Two common derived values answer different descriptive questions. %B = (close − lower band) ÷ (upper band − lower band) places the close relative to the current envelope; it can be below 0 or above 1 when price is outside. BandWidth is (upper − lower) ÷ basis × 100%, a normalized measure of current envelope width. In the fictional example, the close at 102 gives %B ≈ 0.854 and BandWidth ≈ 5.66%. Neither number is a probability, forecast, or direction by itself. The indicator’s creator describes %B as relative position and BandWidth as normalized width; the usual two-standard-deviation settings do not turn price into a normally distributed 95% event.

The calculation convention matters even on a tiny example. The five closes have squared deviations summing to 10. Dividing by 5 gives the population variance 2 and the bands shown above. Dividing by 4 gives sample variance 2.5, standard deviation about 1.581, and bands about 96.84 and 103.16; the same close then has %B about 0.816 and BandWidth about 6.32%. Document the platform’s actual deviation convention and verify its output instead of assuming implementations agree. TradingView exposes band inputs such as source and basis type, while Pine’s reference documents standard-deviation functions and their estimate option.

For a squeeze hypothesis, define “narrow” from a historical training window—for example, below a chosen BandWidth percentile—and freeze that threshold before evaluating later data. A narrow band describes compression under the chosen rule; it does not identify breakout direction. Test the post-compression continuation rule separately from any fade rule, include quiet and failed expansions, and account for selection when many lengths or percentiles were tried.

Bollinger percent B and normalized bandwidth with deviation sensitivityUsing five fictional closes, population standard deviation yields a percent B near 0.854 and bandwidth near 5.66 percent. Sample standard deviation widens the bands, changing those descriptive values to about 0.816 and 6.32 percent. Percent B describes relative position and bandwidth describes envelope width; neither predicts direction.SAME CLOSES · TWO MEASURES · CONVENTION CHANGES THE ENVELOPEPopulation deviation · σ = √2Bands: 97.17 · 100 · 102.83%B ≈ 0.854Relative close position in the envelopeBandWidth ≈ 5.66%Sample deviation · s = √2.5Bands: 96.84 · 100 · 103.16%B ≈ 0.816Relative close position in the envelopeBandWidth ≈ 6.32%Width describes dispersion; neither measure supplies direction or a probability
Using five fictional closes, population standard deviation yields a percent B near 0.854 and bandwidth near 5.66 percent. Sample standard deviation widens the bands, changing those descriptive values to about 0.816 and 6.32 percent. Percent B describes relative position and bandwidth describes envelope width; neither predicts direction. Illustrative teaching graphic · not live market data

Separate the signal bar from the modeled fill

For a close-based rule, the final value of a bar is not available while that bar is still forming. A reproducible test says whether its band uses only earlier closes or includes the newly completed close, then records the signal at the first time all inputs are known. That choice can change both the threshold and the timestamp of the decision.

TradingView’s Pine Script strategy documentation describes a platform-specific default: a strategy that calculates after a historical bar closes and creates a market order then generally models the earliest fill on the next available tick, usually the next bar’s open. A setting can change that behavior. This is a simulator convention, not a statement about every backtest engine or an exchange’s actual execution. A live limit order can miss, a market order can sweep depth, and fees and slippage remain separate from the indicator value.

For example, write the rule as: “At the confirmed close of bar t, compare that close with the upper band computed from the previous 20 completed closes. If it is above, record a breakout observation; model a market entry no earlier than the next available event.” A different rule may include bar t in the band calculation or use a re-entry condition. Both are testable, but choosing whichever version looks best after seeing results is another strategy search. Freeze one version, state the execution assumption and rerun the arithmetic before comparing outcomes.

completed Bollinger signal and next-tick modeled fillA fictional systematic test freezes the band inputs before the bar closes, evaluates the completed close, records the signal, then models an order at the next available event. TradingView's default historical broker-emulator behavior commonly places a close-generated market order at the next bar open; this is a platform-specific model, not a guarantee of a venue fill.WHEN THE RULE KNOWS · WHEN THE SIMULATOR MODELS AN ORDERPRIOR BARSSIGNAL BAR · tNEXT BAR · t+1Bands from stated inputswindow · source · deviationBar completes · close is confirmedevaluate rule · record signalOrder modelnext available tickDo not backdate a decision to information that was not yet finalA close-time signal is not automatically a close-time fillOrder timing, slippage, fees and the venue's actual response remain separate evidenceTradingView default emulator example · not live execution evidence
A fictional systematic test freezes the band inputs before the bar closes, evaluates the completed close, records the signal, then models an order at the next available event. TradingView's default historical broker-emulator behavior commonly places a close-generated market order at the next bar open; this is a platform-specific model, not a guarantee of a venue fill. Illustrative teaching graphic · not live market data

Test the two readings as separate rules

A reversion test might require a completed close below the lower band, then wait for a separately defined re-entry condition before recording a hypothetical long. Specify the exit, invalidation, maximum hold and whether the strategy may add to a position. The failure case is a sustained move farther below the band or a return that arrives only after modeled costs overwhelm the result.

A continuation test might treat a completed close above the upper band as an initial breakout observation and evaluate a later entry under a declared risk cap. Define a failure condition such as a subsequent close back inside the bands. Keep this test separate from the reversion test: they use different hypotheses, entry timing and failure cases. If you try multiple settings or interpretations, preserve the full search rather than publishing only the best combination.

The indicator’s creator cautions that a band tag is not a signal by itself, that price can walk a band during a trend, and that an outside close initially belongs to the continuation interpretation. The same guidance warns readers not to treat two standard deviations as a normally distributed 95% boundary; typical observed containment with common settings may be nearer 90%. Those are methodological cautions, not proof that either crypto rule is profitable.

Make a fair comparison

Use chronological windows and one declared price source. Record band parameters, completed-bar timing, trade count, holding time, drawdown and costs. Include spread, fees, slippage and funding when the modeled instrument is a perpetual. Compare each rule with a simple same-market baseline, and report losing periods and nearby parameter results. Do not select a window after scanning many alternatives and then present it as an untouched evaluation.

SuperQuant’s public strategy examples do not include an arbitrary Bollinger-rule builder. The article does not promise that the app can run either custom setup, and its bundled hourly histories are synthetic. Read mean reversion, breakout research and backtest overfitting. This is research education, not a signal or financial advice.