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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。