Guides, manuals and platform references.
A Bollinger Band squeeze identifies low recent volatility. It does not tell you whether the next breakout will be up or down. Treating narrow bands as a buy signal quietly adds a directional opinion that the measurement itself never supplied.
That distinction matters in TradingView automation: a condition that says “watch this market” is not yet an instruction to open a position. Before using the AlgoWay guide to automating TradingView alerts, define the separate event that authorizes a trade, its direction, and when the setup expires.
Bollinger Bands commonly use a 20-period simple moving average with outer bands two standard deviations above and below it. These are settings, not laws. On an intraday chart, periods are chart bars rather than whole trading days. With the settings held constant, narrower bands reflect lower dispersion in the chosen price series. TradingView documents the construction in its Bollinger Bands reference.
BandWidth expresses the distance between the outer bands relative to the middle band:
BandWidth (%) = (upper band - lower band) / middle band × 100
TradingView's BandWidth documentation stresses that narrowness is relative to the instrument and timeframe. A number that is unusually low for one market may be routine in another. The formula measures width, not a bullish or bearish forecast.
For a hypothetical positive-priced instrument with a middle band of 100, an upper band of 101 and a lower band of 99, BandWidth is 2%. Bands at 103 and 97 would give 6%. The first envelope is narrower, but neither calculation contains the next price. A measuring tape is a poor fortune-teller.
A usable specification needs to answer three different questions. The following is an illustrative research design, not a tested strategy or recommended parameter set:
| Stage | Example rule to test | What it decides |
|---|---|---|
| Setup | A completed bar's BandWidth is below a threshold selected from earlier research data. | Whether compression qualifies for observation. |
| Trigger | Within the next five completed bars, the first close above its upper band selects long; the first close below its lower band selects short. | Direction and the decision event. |
| Reset | Consume the setup after one trigger, or discard it after five bars without one. | Whether another event belongs to the same setup. |
Specify the details that a chart caption can get away with omitting. Does “below” mean strictly below? Are you using the completed trigger bar's band or the preceding bar's band? Does another narrow bar restart the five-bar timer? In the example above, keep the original expiry until the setup is consumed or expires. These choices can produce different trades even when the pictures look much alike.
Also decide whether a new trigger is allowed while a position is open. Position size, protective exits and maximum exposure remain separate rules. Band compression does not supply any of them.
TradingView explicitly notes that a breakout after compression can pull back immediately. Its Bollinger Bands guide also explains that price can repeatedly touch an outer band during a strong trend. Thus an upper-band touch is neither guaranteed continuation nor an automatic reason to sell.
Consider two hypothetical continuations after the same squeeze. In one, the first qualifying close is above the upper band and later closes continue higher. In the other, the same initial trigger occurs, then price returns inside the bands and falls. Your entry logic sees the same event at the decision point. Only subsequent prices reveal which story happened.
Waiting for a completed bar or adding a trend filter changes the definition and timing of entry; it does not remove that uncertainty. If you want to compare a volatility setup with a directional band indicator, the Supertrend settings guide explains the different role of ATR length and multiplier.
Record the symbol, timeframe, band length, source, deviation multiplier, compression threshold and exact trigger rule before comparing results. Keep the exit and sizing rules unchanged while testing one entry change. Otherwise a better-looking result cannot tell you which change mattered.
Use an earlier research period to choose the threshold and reserve a later period for checking it. Count failed breakouts as well as successful ones, include trading costs, and examine whether a small number of trades dominate the result. No backtest or performance claim is being made here.
For an alert dry run, keep a short decision ledger: setup time, expiry time, trigger bar, selected direction and whether the setup was consumed. Compare that ledger with actual alert events before allowing it to control an account. If you cannot explain why the second alert did or did not fire, the rule still has a blank where the computer needs an answer.