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.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。