OPEN-SOURCE SCRIPT
Adaptive Bollinger Bands+ [MAB]

Adaptive Bollinger Bands+ is an intelligent volatility-based indicator that removes the need to manually select a standard deviation multiplier. Rather than locking in a single fixed band width, it continuously evaluates a range of multipliers in parallel and automatically selects the one that has been performing best on recent price action — delivering Bollinger Bands that self-tune to current market conditions.
🔶 HOW IT WORKS
Standard Bollinger Bands require the user to commit to one multiplier, which may be too tight during trending markets or too wide during consolidation. Adaptive Bollinger Bands+ addresses this by running multiple band instances simultaneously across a user-defined multiplier range. Each instance is scored using an exponential performance metric that tracks how well its band width has aligned with directional price movement. On every bar, the highest-scoring multiplier is selected and passed through a short EMA smoother before rendering the final bands — preventing abrupt band jumps when the optimal multiplier switches between bars.
🔶 USAGE
🔹 Band & Trend State
Teal lower band + teal fill — Bullish condition active. Price has broken above the upper band and the indicator is tracking upside momentum.
Red upper band + red fill — Bearish condition active. Price has broken below the lower band and the indicator is tracking downside momentum.
Gray basis line — The simple moving average of the source, acting as the dynamic midline and mean-reversion reference.
🔹 Trade Signals
Teal triangle (▲) below bar — Bullish signal. Price has broken out above the adaptive upper band, indicating a potential long entry or bullish trend shift.
Red triangle (▼) above bar — Bearish signal. Price has broken down below the adaptive lower band, indicating a potential short entry or bearish trend shift.
Because the active multiplier adapts to recent performance and is smoothed before application, signals from Adaptive Bollinger Bands+ reflect band levels that have been validated against current volatility — not a static width chosen arbitrarily.
🔶 SETTINGS
🔹 Band Settings
BB Length — Lookback period for the moving average and standard deviation calculation. Controls the responsiveness of the basis line and band width to recent price action.
Source — The price input used for all calculations. Defaults to close.
🔹 Multiplier Range
Min StdDev Multiplier — The smallest band multiplier included in the tested range.
Max StdDev Multiplier — The largest band multiplier included in the tested range.
Multiplier Step — The increment between each tested multiplier. Smaller steps produce a finer search but increase computation.
🔹 Smoothing
Multiplier Smooth Length — EMA length applied to the selected best multiplier before rendering the final bands. Prevents sudden band spikes when the optimal multiplier shifts between bars. Higher values produce smoother transitions.
🔶 NOTES
Suitable for any market and timeframe.
Best used as a volatility filter, trend identifier, or breakout confirmation tool alongside your existing strategy.
The basis line can serve as a dynamic mean-reversion target during ranging conditions.
Past performance of any selected multiplier does not guarantee future results. Always apply proper risk management.
🔶 HOW IT WORKS
Standard Bollinger Bands require the user to commit to one multiplier, which may be too tight during trending markets or too wide during consolidation. Adaptive Bollinger Bands+ addresses this by running multiple band instances simultaneously across a user-defined multiplier range. Each instance is scored using an exponential performance metric that tracks how well its band width has aligned with directional price movement. On every bar, the highest-scoring multiplier is selected and passed through a short EMA smoother before rendering the final bands — preventing abrupt band jumps when the optimal multiplier switches between bars.
🔶 USAGE
🔹 Band & Trend State
Teal lower band + teal fill — Bullish condition active. Price has broken above the upper band and the indicator is tracking upside momentum.
Red upper band + red fill — Bearish condition active. Price has broken below the lower band and the indicator is tracking downside momentum.
Gray basis line — The simple moving average of the source, acting as the dynamic midline and mean-reversion reference.
🔹 Trade Signals
Teal triangle (▲) below bar — Bullish signal. Price has broken out above the adaptive upper band, indicating a potential long entry or bullish trend shift.
Red triangle (▼) above bar — Bearish signal. Price has broken down below the adaptive lower band, indicating a potential short entry or bearish trend shift.
Because the active multiplier adapts to recent performance and is smoothed before application, signals from Adaptive Bollinger Bands+ reflect band levels that have been validated against current volatility — not a static width chosen arbitrarily.
🔶 SETTINGS
🔹 Band Settings
BB Length — Lookback period for the moving average and standard deviation calculation. Controls the responsiveness of the basis line and band width to recent price action.
Source — The price input used for all calculations. Defaults to close.
🔹 Multiplier Range
Min StdDev Multiplier — The smallest band multiplier included in the tested range.
Max StdDev Multiplier — The largest band multiplier included in the tested range.
Multiplier Step — The increment between each tested multiplier. Smaller steps produce a finer search but increase computation.
🔹 Smoothing
Multiplier Smooth Length — EMA length applied to the selected best multiplier before rendering the final bands. Prevents sudden band spikes when the optimal multiplier shifts between bars. Higher values produce smoother transitions.
🔶 NOTES
Suitable for any market and timeframe.
Best used as a volatility filter, trend identifier, or breakout confirmation tool alongside your existing strategy.
The basis line can serve as a dynamic mean-reversion target during ranging conditions.
Past performance of any selected multiplier does not guarantee future results. Always apply proper risk management.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Pine Script Developer • Market Analysis
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Pine Script Developer • Market Analysis
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.