OPEN-SOURCE SCRIPT
ที่อัปเดต: BBW Advanced (Percentiles & Regime)

Bollinger BandWidth Advanced (Percentiles & Regime)
Description
This indicator is an advanced implementation of Bollinger BandWidth (BBW) focused on volatility regimes, not trade signals.
Unlike the standard BBW, which relies on fixed thresholds or recent highs/lows, this version uses statistical percentiles and normalization to adapt automatically to different assets and timeframes.
Its purpose is to identify abnormal volatility compression and expansion and, more importantly, the transitions between regimes.
Key Improvements Over Standard BBW
1. Percentile-based thresholds
Instead of arbitrary levels, BBW is evaluated relative to its own historical distribution:
Low percentile (e.g. 5th) → extreme compression
High percentile (e.g. 95th) → extreme expansion
This makes the indicator adaptive and statistically meaningful across markets.
2. Volatility normalization
BBW is normalized by its own historical mean, allowing comparison across:
Different instruments
Different timeframes
A normalized value around 1 represents “normal” volatility for that market.
3. Regime classification instead of signals
The indicator does not generate buy/sell signals.
It classifies the market into volatility regimes and highlights regime transitions, which must be interpreted together with price structure.
How to Interpret the Indicator
Blue Line – BBW
Raw Bollinger BandWidth value.
Represents relative volatility only. Not a trading trigger.
Green Line – Low Percentile (Extreme Compression)
Marks statistically rare low-volatility conditions.
Price is compressed; energy is building, but direction is unknown.
Red Line – High Percentile (Extreme Expansion)
Marks unusually high volatility.
Often associated with breakouts, trends, or late-stage moves.
Orange Line – Normalized BBW
Shows current volatility relative to its historical average:
Below ~0.7 → very low volatility
Around 1.0 → normal volatility
Above ~1.5 → unusually high volatility
Background Colors
Green background → BBW is below the low percentile (extreme compression)
Red background → BBW is above the high percentile (extreme expansion)
Background colors indicate market state, not entries.
Practical Use
Extreme compression highlights environments where breakouts may develop, but does not predict direction
The most useful moment is the exit from compression, when volatility starts expanding again
Always combine with price action, structure, and context
BBW should be treated as a condition filter, never as a standalone strategy
Important Notes
This indicator measures volatility only, not trend or bias
Compression does not guarantee a breakout
Expansion does not guarantee continuation
Misuse as a signal generator will lead to poor results
Description
This indicator is an advanced implementation of Bollinger BandWidth (BBW) focused on volatility regimes, not trade signals.
Unlike the standard BBW, which relies on fixed thresholds or recent highs/lows, this version uses statistical percentiles and normalization to adapt automatically to different assets and timeframes.
Its purpose is to identify abnormal volatility compression and expansion and, more importantly, the transitions between regimes.
Key Improvements Over Standard BBW
1. Percentile-based thresholds
Instead of arbitrary levels, BBW is evaluated relative to its own historical distribution:
Low percentile (e.g. 5th) → extreme compression
High percentile (e.g. 95th) → extreme expansion
This makes the indicator adaptive and statistically meaningful across markets.
2. Volatility normalization
BBW is normalized by its own historical mean, allowing comparison across:
Different instruments
Different timeframes
A normalized value around 1 represents “normal” volatility for that market.
3. Regime classification instead of signals
The indicator does not generate buy/sell signals.
It classifies the market into volatility regimes and highlights regime transitions, which must be interpreted together with price structure.
How to Interpret the Indicator
Blue Line – BBW
Raw Bollinger BandWidth value.
Represents relative volatility only. Not a trading trigger.
Green Line – Low Percentile (Extreme Compression)
Marks statistically rare low-volatility conditions.
Price is compressed; energy is building, but direction is unknown.
Red Line – High Percentile (Extreme Expansion)
Marks unusually high volatility.
Often associated with breakouts, trends, or late-stage moves.
Orange Line – Normalized BBW
Shows current volatility relative to its historical average:
Below ~0.7 → very low volatility
Around 1.0 → normal volatility
Above ~1.5 → unusually high volatility
Background Colors
Green background → BBW is below the low percentile (extreme compression)
Red background → BBW is above the high percentile (extreme expansion)
Background colors indicate market state, not entries.
Practical Use
Extreme compression highlights environments where breakouts may develop, but does not predict direction
The most useful moment is the exit from compression, when volatility starts expanding again
Always combine with price action, structure, and context
BBW should be treated as a condition filter, never as a standalone strategy
Important Notes
This indicator measures volatility only, not trend or bias
Compression does not guarantee a breakout
Expansion does not guarantee continuation
Misuse as a signal generator will lead to poor results
เอกสารเผยแพร่
BBW Advanced with Percentile RankDescription
This indicator is an advanced version of Bollinger BandWidth (BBW) designed for quantitative analysis of volatility regimes.
Unlike the standard BBW, which relies on fixed values or recent highs/lows, this version introduces a Percentile Rank (0–100) that shows where current volatility stands relative to its own historical distribution.
This makes the indicator suitable for rule-based checklists, statistics, and backtesting, not just visual analysis.
The indicator does not generate trade signals. Its purpose is to objectively describe market volatility conditions and transitions.
Key Features
1. Percentile Rank (0–100)
The core improvement.
The indicator calculates the exact percentile rank of the current BBW value over a historical lookback window.
Examples:
BBW Percentile Rank = 3 → volatility is lower than 97% of recent observations
BBW Percentile Rank = 50 → normal volatility
BBW Percentile Rank = 92 → unusually high volatility
This allows precise rules such as:
“Number of days with BBW < 5%”
“Trades taken when BBW < 10%”
“Performance by volatility regime”
2. Percentile-Based Regime Levels
Low and high percentile thresholds (e.g. 5% and 95%) are plotted to identify:
Extreme volatility compression
Extreme volatility expansion
These levels adapt automatically to the asset and timeframe.
3. Volatility Normalization
BBW is also normalized by its historical mean, allowing comparison across:
Different markets
Different timeframes
A normalized value around 1 represents typical volatility for that market.
How to Interpret the Visuals
Blue Line — BBW
Raw Bollinger BandWidth.
Measures volatility only, not direction.
Purple Line — BBW Percentile Rank (0–100)
Shows the current volatility percentile.
This is the primary value for checklists, filters, and backtests.
Green Horizontal Level — Low Percentile Threshold
Defines extreme volatility compression.
Red Horizontal Level — High Percentile Threshold
Defines extreme volatility expansion.
Orange Line — Normalized BBW
Shows volatility relative to its own historical average.
Background Colors
Green background → BBW Percentile Rank below the low threshold (extreme compression)
Red background → BBW Percentile Rank above the high threshold (extreme expansion)
Background colors indicate market regime, not trade entries.
Practical Use
Use low percentile values to identify prolonged volatility compression
Focus on transitions out of compression as a context shift, not as a signal
Combine with price structure, volume, and execution rules
Treat the indicator as a condition filter, not a standalone strategy
Important Notes
This indicator measures volatility only
It does not predict direction
Compression does not guarantee a breakout
Expansion does not guarantee continuation
Misuse as a signal generator will lead to misleading results
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน