OPEN-SOURCE SCRIPT
Enhanced Bollinger Bands [Regime + %B Decay]

A modular rewrite of classic Bollinger Bands. Most BB indicators just plot bands; this one treats them as a system with four moving parts.
Adaptive basis. Pick SMA, EMA, HMA, KAMA (with tunable fast/slow SC), or VWMA. HMA tracks trend with low lag; KAMA adapts to noise; VWMA weights by volume.
Asymmetric bands (optional). Instead of one σ for both sides, upper/lower bands can use upside/downside semi-deviation (√2-normalized so magnitudes stay comparable to symmetric σ). Useful for markets with persistent skew. A floor at 50% of symmetric σ prevents the semi-dev from collapsing to zero in one-sided trends — a known failure mode of naive semi-dev bands.
Regime classification. Every bar is tagged SQUEEZE / WALK_UP / WALK_DOWN / RANGE. Squeeze detection supports TTM-style nesting (BB inside Keltner), bandwidth percentile (current BW vs. its own history — recommended ≥500 bars on crypto 1H), or both. The regime drives the background color so you can read the state at a glance.
%B Decay — the reversal trigger. During an active band walk, the script tracks each new price extreme and the %B at that bar. If price keeps making new highs but %B at those highs is decreasing, the penetration depth is fading: price is still grinding higher, but its relative extreme vs. the volatility-adaptive band is shrinking. After N consecutive decays (default 2, configurable), an orange triangle prints. Conceptually this is a price-vs-adaptive-threshold divergence, scoped to where it matters — inside an active walk, not on every bar. Cleaner than RSI divergence because the threshold itself adapts to volatility.
Adaptive basis. Pick SMA, EMA, HMA, KAMA (with tunable fast/slow SC), or VWMA. HMA tracks trend with low lag; KAMA adapts to noise; VWMA weights by volume.
Asymmetric bands (optional). Instead of one σ for both sides, upper/lower bands can use upside/downside semi-deviation (√2-normalized so magnitudes stay comparable to symmetric σ). Useful for markets with persistent skew. A floor at 50% of symmetric σ prevents the semi-dev from collapsing to zero in one-sided trends — a known failure mode of naive semi-dev bands.
Regime classification. Every bar is tagged SQUEEZE / WALK_UP / WALK_DOWN / RANGE. Squeeze detection supports TTM-style nesting (BB inside Keltner), bandwidth percentile (current BW vs. its own history — recommended ≥500 bars on crypto 1H), or both. The regime drives the background color so you can read the state at a glance.
%B Decay — the reversal trigger. During an active band walk, the script tracks each new price extreme and the %B at that bar. If price keeps making new highs but %B at those highs is decreasing, the penetration depth is fading: price is still grinding higher, but its relative extreme vs. the volatility-adaptive band is shrinking. After N consecutive decays (default 2, configurable), an orange triangle prints. Conceptually this is a price-vs-adaptive-threshold divergence, scoped to where it matters — inside an active walk, not on every bar. Cleaner than RSI divergence because the threshold itself adapts to volatility.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.