OPEN-SOURCE SCRIPT
Bollinger Bands with 4 Moving Averages

Combines Bollinger Bands (BB) with up to four optional Moving Averages (MA) to read volatility, trend direction, and dynamic support–resistance in one overlay.
How It Works
BB: basis = MA(length, type) with standard deviation mult. upper = basis + dev, lower = basis − dev.
MA1–MA4: additional averages you can toggle (default only MA4/200 enabled).
Key Features
Flexible basis MA type for BB: SMA / EMA / RMA (Wilder) / WMA / VWMA.
Four optional MAs with independent length, color, and width (defaults: 7, 25, 99, 200; only 200 on by default).
Offset to shift BB for visual testing.
Overlay on price with shaded band between Upper–Lower.
Inputs & Defaults
BB Length = 20, StdDev = 2.0, Source = close.
Basis MA Type = SMA.
MA4 active (200), MA1–MA3 off (7/25/99 ready).
Offset = 0.
Practical Use
Use BB for volatility context: squeeze → potential breakout; expansion → strong trend.
Treat Basis / Upper / Lower as dynamic levels:
Pullbacks to Basis often become decision zones in trends.
Upper/Lower touches = relative extremes.
Add MA4(200) for primary bias; enable MA1–MA3 for finer timing.
Typical behavior:
Price > MA200 and rising basis → bullish bias; watch pullbacks to basis/MA25-like zones.
Price < MA200 and falling basis → bearish bias; watch rejections at basis/MAs.
Common Signals (not financial advice)
Breakout + BB expansion confirms momentum.
Squeeze + basis break can preface volatility expansion.
Confluence: Lower touch + fast MA in uptrends → mean-reversion setups; inverse for downtrends.
Notes
MA1–MA4 are SMA in the code; BB basis follows the selected MA type.
Test across timeframes; tune length and mult to the asset.
Disclaimer
Visual tool only. Combine with risk management, multi-timeframe confirmation, and a tested plan.
How It Works
BB: basis = MA(length, type) with standard deviation mult. upper = basis + dev, lower = basis − dev.
MA1–MA4: additional averages you can toggle (default only MA4/200 enabled).
Key Features
Flexible basis MA type for BB: SMA / EMA / RMA (Wilder) / WMA / VWMA.
Four optional MAs with independent length, color, and width (defaults: 7, 25, 99, 200; only 200 on by default).
Offset to shift BB for visual testing.
Overlay on price with shaded band between Upper–Lower.
Inputs & Defaults
BB Length = 20, StdDev = 2.0, Source = close.
Basis MA Type = SMA.
MA4 active (200), MA1–MA3 off (7/25/99 ready).
Offset = 0.
Practical Use
Use BB for volatility context: squeeze → potential breakout; expansion → strong trend.
Treat Basis / Upper / Lower as dynamic levels:
Pullbacks to Basis often become decision zones in trends.
Upper/Lower touches = relative extremes.
Add MA4(200) for primary bias; enable MA1–MA3 for finer timing.
Typical behavior:
Price > MA200 and rising basis → bullish bias; watch pullbacks to basis/MA25-like zones.
Price < MA200 and falling basis → bearish bias; watch rejections at basis/MAs.
Common Signals (not financial advice)
Breakout + BB expansion confirms momentum.
Squeeze + basis break can preface volatility expansion.
Confluence: Lower touch + fast MA in uptrends → mean-reversion setups; inverse for downtrends.
Notes
MA1–MA4 are SMA in the code; BB basis follows the selected MA type.
Test across timeframes; tune length and mult to the asset.
Disclaimer
Visual tool only. Combine with risk management, multi-timeframe confirmation, and a tested plan.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.