OPEN-SOURCE SCRIPT
Bollinger Band Oscillator (Distance between 2 bands)

📌 Bollinger Band Width Oscillator
Description
This indicator measures the distance between the Upper and Lower Bollinger Bands and displays it as an oscillator. It is designed to help traders track squeeze (contraction) and expansion phases in the market, which often precede significant price moves.
Calculation
Bollinger Bands are built from a moving average (MA) and standard deviation.
Band Width = Upper Band – Lower Band.
Users can normalize the width in three ways:
Absolute: raw value in price units.
% of Basis: width relative to the MA (useful for cross-asset or multi-timeframe comparison).
ATR-normalized: width divided by ATR, filtering out absolute volatility effects.
Interpretation
Low oscillator values → Bands are contracting → market is consolidating, often a precursor to volatility breakouts.
High oscillator values → Bands are expanding → market is experiencing strong volatility or following a breakout.
The included Signal line can help identify turning points when the oscillator crosses above/below it.
Customization
Select MA type (SMA, EMA, SMMA, WMA, VWMA).
Adjust StdDev multiplier.
Choose normalization (Absolute, % Basis, ATR).
Optional smoothing and histogram/line display.
👉 Practical Use:
Detect upcoming breakouts by spotting “squeeze” conditions.
Compare volatility regimes across assets or timeframes.
Enhance breakout or trend-following strategies with volatility context.
🔹 Short Description (for TradingView search/preview)
Measures the width of Bollinger Bands as an oscillator. Helps identify squeeze and expansion phases, anticipate breakouts, and track volatility across assets or timeframes.
Description
This indicator measures the distance between the Upper and Lower Bollinger Bands and displays it as an oscillator. It is designed to help traders track squeeze (contraction) and expansion phases in the market, which often precede significant price moves.
Calculation
Bollinger Bands are built from a moving average (MA) and standard deviation.
Band Width = Upper Band – Lower Band.
Users can normalize the width in three ways:
Absolute: raw value in price units.
% of Basis: width relative to the MA (useful for cross-asset or multi-timeframe comparison).
ATR-normalized: width divided by ATR, filtering out absolute volatility effects.
Interpretation
Low oscillator values → Bands are contracting → market is consolidating, often a precursor to volatility breakouts.
High oscillator values → Bands are expanding → market is experiencing strong volatility or following a breakout.
The included Signal line can help identify turning points when the oscillator crosses above/below it.
Customization
Select MA type (SMA, EMA, SMMA, WMA, VWMA).
Adjust StdDev multiplier.
Choose normalization (Absolute, % Basis, ATR).
Optional smoothing and histogram/line display.
👉 Practical Use:
Detect upcoming breakouts by spotting “squeeze” conditions.
Compare volatility regimes across assets or timeframes.
Enhance breakout or trend-following strategies with volatility context.
🔹 Short Description (for TradingView search/preview)
Measures the width of Bollinger Bands as an oscillator. Helps identify squeeze and expansion phases, anticipate breakouts, and track volatility across assets or timeframes.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน