OPEN-SOURCE SCRIPT

Adaptive Bollinger Bands+ [MAB]

830
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.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.