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 de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.