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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.