OPEN-SOURCE SCRIPT
已更新

BBW Advanced (Percentiles & Regime)

144
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
版本注释
BBW Advanced with Percentile Rank
Description

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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。