BBANDS: Bollinger Bands
Dynamic volatility envelope plotting upper and lower standard deviation bands around a moving average.
close < @BBANDS(close, 20, 2.0, 2.0, 0)[2] Key Takeaways
- Self-adjusting envelope that widens during high volatility and contracts during market lulls.
- Captures ~95% of historical price action under normal statistical distributions.
- Bollinger Squeeze (bandwidth compression) is one of the most reliable precursors to explosive trend expansion.
What It Means in Simple Terms
Bollinger Bands place dynamic guardrails around a stock's moving average. Think of them like elastic riverbanks: when water is calm, the banks contract tightly together (low volatility). When a flood hits, the banks expand widely to contain the raging water (high volatility). Because the bands are set 2 standard deviations away, about 95% of all daily price action naturally stays inside the channel.
How It Helps You as an Investor
It serves two completely different trading playbooks: 1) Squeeze Breakouts: When the bands pinch together to their tightest level in months, an explosive breakout is imminent. 2) Mean Reversion: When a stock plunges outside the lower band during a panic, it is statistically stretched like a rubber band and ready to snap back.
Visual Node Rule Syntax & How to Plug in Values
close < @BBANDS(close, 20, 2.0, 2.0, 0)[2] Parameter Tuning & Market Calibration
Standard configuration: Lookback = 20, Multiplier = 2.0. If you tighten the multiplier to 1.5, the bands hug price closer, generating more frequent touches (good for scalping ranges). If you expand to 2.5 or 3.0, you isolate only extreme statistical black-swan deviations.
Input Fields & Parameters
| Field / Parameter | Type | Default | Role & Description |
|---|---|---|---|
close | field | Required | Historical input price or volume series from market feed. |
timeperiod | int | 5 | Lookback period or tuning parameter for market calibration. |
nbdevup | float | 2 | Lookback period or tuning parameter for market calibration. |
nbdevdn | float | 2 | Lookback period or tuning parameter for market calibration. |
matype | int | 0 | Lookback period or tuning parameter for market calibration. |
Mathematical Formulation
The mathematical definition of BBANDS (Bollinger Bands) as evaluated within the Saral Engine execution pipeline:
Variable & Parameter Definitions
$SMA_n$ is the $n$-period moving average, $\sigma_n$ is the rolling standard deviation of close prices, and $k$ is the bandwidth multiplier (typically 2.0).
Systematic Strategy Applications
close < @BBANDS(close, 20, 2.0, 2.0, 0)[2] and @RSI(close, 14) < 30 Buy high-quality large-cap equities when price stretches below the 2-sigma lower band during an emotional selloff.
Common Questions & Practical Considerations
Can a stock keep going up even after touching the upper Bollinger Band?
Yes! In strong momentum rallies, stocks frequently 'walk the band'—pressing against the upper rail for days or weeks. Never short a stock just because it touches the upper band without confirmation of trend exhaustion.
What is the Bollinger Band Squeeze?
A squeeze occurs when band width (Upper minus Lower divided by Middle) reaches a multi-month low. It signals that volatility has compressed to an unsustainable level and a massive directional breakout is imminent.