OPEN-SOURCE SCRIPT
Bollinger Band Toolkit

Bollinger Band Toolkit
An advanced, adaptive Bollinger Band system for traders who want more context, precision, and edge.
This indicator expands on the classic Bollinger Bands by combining statistical and volatility-based methods with modern divergence and squeeze detection tools. It helps identify volatility regimes, potential breakouts, and early momentum shifts — all within one clean overlay.
🔹 Core Features
1. Adaptive Bollinger Bands (σ + ATR)
Classic 20-period bands enhanced with an ATR-based volatility adjustment, making them more responsive to true market movement rather than just price variance.
Reduces “overreacting” during chop and avoids bands collapsing too tightly during trends.
2. %B & RSI Divergence Detection
🟢 Green dots: Positive %B divergence — price makes a lower low, but %B doesn’t confirm (bullish).
🔴 Red dots: Negative %B divergence — price makes a higher high, but %B doesn’t confirm (bearish).
✚ Red/green crosses: RSI divergence confirmation — momentum fails to confirm the price’s new extreme.
These signals highlight potential reversal or slowdown zones that are often invisible to the naked eye.
3. Bollinger Band Squeeze (with Volume Filter)
Yellow squares (■) show periods when Bollinger Bands are at their narrowest relative to recent history.
Volume confirmation ensures the squeeze only triggers when both volatility and participation contract.
Often marks the “calm before the storm” — breakout potential zones.
4. Multi-Timeframe Breakout Markers
Optionally displays breakouts from higher or lower timeframes using different colors/symbols.
Lets you see when a higher timeframe band break aligns with your current chart — a strong trend continuation signal.
5. Dual- and Triple-Band Visualization (±1σ, ±2σ, ±3σ)
Optional inner (±1σ) and outer (±3σ) bands provide a layered volatility map:
Price holding between ±1σ → stable range / mean-reverting behavior
Price riding near ±2σ → trending phase, sustained momentum
Price touching or exceeding ±3σ → volatility expansion or exhaustion zone
This triple-band layout visually distinguishes normal movement from statistical extremes, helping you read when the market is balanced, expanding, or approaching its limits.
⚙️ Inputs & Customization
Choose band type (SMA/EMA/SMMA/WMA/VWMA)
Adjust deviation multiplier (σ) and ATR multiplier
Toggle individual features (divergence dots, squeeze markers, inner bands, etc.)
Multi-timeframe and colour controls for advanced users
🧠 How to Use
Watch for squeeze markers followed by a breakout bar beyond ±2σ → volatility expansion signal.
Combine divergence dots with RSI or price structure to anticipate slowdowns or reversals.
Confirm direction using multi-timeframe breakouts and volume expansion.
💬 Why It Works
This toolkit transforms qualitative chart reading (tight bands, hidden divergence) into quantitative, testable conditions — giving you objective insights that can be backtested, coded, or simply trusted in live setups.
An advanced, adaptive Bollinger Band system for traders who want more context, precision, and edge.
This indicator expands on the classic Bollinger Bands by combining statistical and volatility-based methods with modern divergence and squeeze detection tools. It helps identify volatility regimes, potential breakouts, and early momentum shifts — all within one clean overlay.
🔹 Core Features
1. Adaptive Bollinger Bands (σ + ATR)
Classic 20-period bands enhanced with an ATR-based volatility adjustment, making them more responsive to true market movement rather than just price variance.
Reduces “overreacting” during chop and avoids bands collapsing too tightly during trends.
2. %B & RSI Divergence Detection
🟢 Green dots: Positive %B divergence — price makes a lower low, but %B doesn’t confirm (bullish).
🔴 Red dots: Negative %B divergence — price makes a higher high, but %B doesn’t confirm (bearish).
✚ Red/green crosses: RSI divergence confirmation — momentum fails to confirm the price’s new extreme.
These signals highlight potential reversal or slowdown zones that are often invisible to the naked eye.
3. Bollinger Band Squeeze (with Volume Filter)
Yellow squares (■) show periods when Bollinger Bands are at their narrowest relative to recent history.
Volume confirmation ensures the squeeze only triggers when both volatility and participation contract.
Often marks the “calm before the storm” — breakout potential zones.
4. Multi-Timeframe Breakout Markers
Optionally displays breakouts from higher or lower timeframes using different colors/symbols.
Lets you see when a higher timeframe band break aligns with your current chart — a strong trend continuation signal.
5. Dual- and Triple-Band Visualization (±1σ, ±2σ, ±3σ)
Optional inner (±1σ) and outer (±3σ) bands provide a layered volatility map:
Price holding between ±1σ → stable range / mean-reverting behavior
Price riding near ±2σ → trending phase, sustained momentum
Price touching or exceeding ±3σ → volatility expansion or exhaustion zone
This triple-band layout visually distinguishes normal movement from statistical extremes, helping you read when the market is balanced, expanding, or approaching its limits.
⚙️ Inputs & Customization
Choose band type (SMA/EMA/SMMA/WMA/VWMA)
Adjust deviation multiplier (σ) and ATR multiplier
Toggle individual features (divergence dots, squeeze markers, inner bands, etc.)
Multi-timeframe and colour controls for advanced users
🧠 How to Use
Watch for squeeze markers followed by a breakout bar beyond ±2σ → volatility expansion signal.
Combine divergence dots with RSI or price structure to anticipate slowdowns or reversals.
Confirm direction using multi-timeframe breakouts and volume expansion.
💬 Why It Works
This toolkit transforms qualitative chart reading (tight bands, hidden divergence) into quantitative, testable conditions — giving you objective insights that can be backtested, coded, or simply trusted in live setups.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.