OPEN-SOURCE SCRIPT
BB Expansion Oscillator (BEXO)

BB Expansion Oscillator (BEXO) is a custom indicator designed to measure and visualize the expansion and contraction phases of Bollinger Bands in a normalized way.
🔹 Core Features:
Normalized BB Width: Transforms Bollinger Band Width into a 0–100 scale for easier comparison across different timeframes and assets.
Signal Line: EMA-based smoothing line to detect trend direction shifts.
Histogram: Highlights expansion vs contraction momentum.
OB/OS Zones: Detects Over-Expansion and Over-Contraction states to spot potential volatility breakouts or squeezes.
Dynamic Coloring & Ribbon: Visual cues for trend bias and crossovers.
Info Table: Displays real-time values and status (Expansion, Contraction, Over-Expansion, Over-Contraction).
Background Highlighting: Optional visual aid for trend phases.
🔹 How to Use:
When BEXO rises above the Signal Line, the market is in an Expansion phase → potential trend continuation.
When BEXO falls below the Signal Line, the market is in a Contraction phase → potential consolidation or trend weakness.
Overbought/Over-Expansion zone (above OB level): Signals high volatility; watch for possible reversal or breakout exhaustion.
Oversold/Over-Contraction zone (below OS level): Indicates a squeeze or low volatility; often precedes strong breakout moves.
🔹 Best Application:
Identify volatility cycles (squeeze & expansion).
Filter trades by volatility conditions.
Combine with price action, volume, or momentum indicators for confirmation.
⚠️ Disclaimer:
This indicator is for educational and research purposes only. It should not be considered financial advice. Always combine with proper risk management and your own trading strategy.
🔹 Core Features:
Normalized BB Width: Transforms Bollinger Band Width into a 0–100 scale for easier comparison across different timeframes and assets.
Signal Line: EMA-based smoothing line to detect trend direction shifts.
Histogram: Highlights expansion vs contraction momentum.
OB/OS Zones: Detects Over-Expansion and Over-Contraction states to spot potential volatility breakouts or squeezes.
Dynamic Coloring & Ribbon: Visual cues for trend bias and crossovers.
Info Table: Displays real-time values and status (Expansion, Contraction, Over-Expansion, Over-Contraction).
Background Highlighting: Optional visual aid for trend phases.
🔹 How to Use:
When BEXO rises above the Signal Line, the market is in an Expansion phase → potential trend continuation.
When BEXO falls below the Signal Line, the market is in a Contraction phase → potential consolidation or trend weakness.
Overbought/Over-Expansion zone (above OB level): Signals high volatility; watch for possible reversal or breakout exhaustion.
Oversold/Over-Contraction zone (below OS level): Indicates a squeeze or low volatility; often precedes strong breakout moves.
🔹 Best Application:
Identify volatility cycles (squeeze & expansion).
Filter trades by volatility conditions.
Combine with price action, volume, or momentum indicators for confirmation.
⚠️ Disclaimer:
This indicator is for educational and research purposes only. It should not be considered financial advice. Always combine with proper risk management and your own trading strategy.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.