StratBase.aiStratBase.ai
DashboardCreate BacktestMy BacktestsCatalogBlogNewsToolsHelp

Products

  • Researcher Dashboard
  • Create Backtest
  • My Backtests
  • Catalog
  • Blog
  • News

Alerts

  • Calendar
  • OI Screener
  • Funding Rate
  • REKT
  • Pump/Dump

Company

  • About Us
  • Pricing
  • Affiliate
  • AI Widget
  • Contact

Legal

  • Privacy
  • Terms
  • Refund Policy

Support

  • Help Center
  • Reviews
StratBase.aiStratBase.ai

Think it. Test it.

StratBase.ai does not provide financial advice or trading recommendations. AI only formalizes user ideas into testable strategy configurations for research purposes. Past backtesting performance does not guarantee future results. All trading decisions and associated risks are the sole responsibility of the user. This platform is not a broker and does not facilitate real trading.

© 2026 StratBase.ai · AI-powered strategy research and backtesting platform

support@stratbase.ai
Help Center/Indicators/Bollinger Bands

Bollinger Bands

📈Indicators
📌

Bollinger Bands (BB)

📋

What is Bollinger Bands?

Bollinger Bands is a volatility indicator developed by John Bollinger in the 1980s. It consists of three lines: a middle band (simple moving average), an upper band, and a lower band. The upper and lower bands are placed at a specified number of standard deviations above and below the middle band, dynamically expanding and contracting based on market volatility.

⚙️

How it works

Bollinger Bands are calculated using a moving average and standard deviation:

Middle Band = SMA(close, N)
Upper Band  = Middle Band + K * StdDev(close, N)
Lower Band  = Middle Band - K * StdDev(close, N)

Where N is the period (default 20) and K is the multiplier (default 2.0).

Two additional sub-components provide normalized readings:

%B         = (close - Lower Band) / (Upper Band - Lower Band)
Bandwidth  = (Upper Band - Lower Band) / Middle Band

%B shows where price is relative to the bands (0 = at lower, 1 = at upper, 0.5 = at middle). Bandwidth measures band width as a percentage of the middle band — useful for detecting squeezes.

⭐

Key features

  • Squeeze — When bands contract tightly, it signals low volatility and often precedes a breakout
  • Expansion — Wide bands indicate high volatility
  • Walking the band — During strong trends, price can stay near the upper or lower band
  • Mean reversion — In ranging markets, price tends to return to the middle band
  • %B overbought/oversold — %B above 1.0 means price is above upper band; below 0.0 means below lower band
📌

Trading signals

Buy signals

  • Price touches or crosses below the lower band and reverses back inside
  • %B crosses above 0 from below (price re-enters bands from below)
  • Bollinger Squeeze followed by price break above upper band
  • Price bounces off the middle band in an uptrend

Sell signals

  • Price touches or crosses above the upper band and reverses back inside
  • %B crosses below 1 from above (price re-enters bands from above)
  • Bollinger Squeeze followed by price break below lower band
  • Price fails to hold the middle band in a downtrend
📌

Parameters

| Parameter | Default | Description | |-----------|---------|-------------| | Period | 20 | Number of candles for SMA and StdDev | | Multiplier (K) | 2.0 | Standard deviation multiplier |

📌

Sub-components

| Component | Description | |-----------|-------------| | BB_UPPER(20) | Upper band value | | BB_LOWER(20) | Lower band value | | BB_PERCENT_B(20) | %B — normalized position within bands | | BB_BANDWIDTH(20) | Bandwidth — relative band width |

💡

Example conditions

| Condition | Description | |-----------|-------------| | close > BB_UPPER(20) | Price above upper band (breakout) | | close < BB_LOWER(20) | Price below lower band (oversold) | | close cross_over BB_LOWER(20) | Price crosses back above lower band | | BB_PERCENT_B(20) > 1 | Price exceeded upper band | | BB_PERCENT_B(20) < 0 | Price below lower band | | BB_BANDWIDTH(20) < 0.05 | Squeeze — very narrow bands |

💡

Tips

  • The default 20-period, 2-StdDev setting captures ~95% of price action within the bands
  • Use %B for quantitative overbought/oversold analysis instead of visual band touches
  • Bandwidth is excellent for detecting Bollinger Squeeze setups — look for historically low values
  • In strong trends, do not fade the band — price can "walk the band" for extended periods
  • Combine with volume indicators to confirm breakouts from squeezes
  • Narrowing bandwidth followed by expansion is one of the most reliable volatility patterns
Related Resources|Fibonacci CalculatorPivot Points CalculatorTrading Blog