OPEN-SOURCE SCRIPT
Güncellendi

SuperBands

340
I've been seeing a lot of volatility band indicators pop up recently, and after watching this trend for a while, I figured it was time to throw my two chips in. The original spark for this idea came years ago from RicardoSantos's Vector Flow Channel script, which used decay channels with timed events in an interesting way. That concept stuck with me, and I kept thinking about how to build something that captured the same kind of dynamic envelope behavior but with a different mathematical foundation. What I ended up with is a hybrid that takes the core logic of supertrend trailing stops, smooths them heavily with exponential moving averages, and wraps them in Donchian-style filled bands with momentum-based color gradients.

The basic mechanism here is pretty straightforward. Standard supertrend calculates a trailing stop based on ATR offset from price, then flips direction when price crosses the trail. This implementation does the same thing but adds EMA smoothing to the trail calculation itself, which removes a lot of the choppiness you get from raw supertrend during sideways periods. The smoothing period is adjustable, so you can tune how reactive versus stable you want the bands to be. Lower smoothing values make the bands track price more aggressively, higher values create wider, slower-moving envelopes that only respond to sustained directional moves.

Where this diverges from typical supertrend implementations is in the visual presentation and the separate treatment of bullish and bearish conditions. Instead of a single flipping line, you get persistent upper and lower bands that each track their own trailing stops independently. The bullish band trails below price and stays active as long as price doesn't break below it. The bearish band trails above price and remains active until price breaks above. Both bands can be visible simultaneously, which gives you a dynamic channel that adapts to volatility on both sides of price action. When price is trending strongly, one band will dominate and the other will disappear. During consolidation, both bands tend to compress toward price.

The color gradients are calculated by measuring the rate of change in each band's position and converting that delta into an angle using arctangent scaling. Steeper angles, which correspond to the band moving quickly to catch up with accelerating price, get brighter colors. Flatter angles, where the band is moving slowly or staying relatively stable, fade toward more muted tones. This gives you a visual sense of momentum within the bands themselves, not just from price movement. A rapidly brightening band often precedes expansion or breakout conditions, while fading colors suggest the trend is losing steam or entering consolidation.

The filled regions between price and each band serve a similar function to Donchian channels or Keltner bands, creating clearly defined zones that represent normal price behavior relative to recent volatility. When price hugs one band and the fill area compresses, you're in a strong directional regime. When price bounces between both bands and the fills expand, you're in a ranging environment. The transparency gradients in the fills make it easier to see when price is near the edge of the envelope versus safely inside it.

Configuration is split between bullish and bearish settings, which lets you asymmetrically tune the indicator if you find that your market or timeframe has different characteristics in uptrends versus downtrends. You can adjust ATR period, ATR multiplier, and smoothing independently for each direction. This flexibility is useful for instruments that exhibit different volatility profiles during bull and bear phases, or for strategies that want tighter trailing on longs than shorts, or vice versa.

The ATR period controls the lookback window for volatility measurement. Shorter periods make the bands react quickly to recent volatility spikes, which can be beneficial in fast-moving markets but also leads to more frequent whipsaws. Longer periods smooth out volatility estimates and create more stable bands at the cost of slower adaptation. The multiplier scales the ATR offset, directly controlling how far the bands sit from price. Smaller multipliers keep the bands tight, triggering more frequent direction changes. Larger multipliers create wider envelopes that give price more room to move without breaking the trail.

One thing to note is that this indicator doesn't generate explicit buy or sell signals in the traditional sense. It's a regime filter and envelope tool. You can use band breaks as directional cues if you want, but the primary value comes from understanding the current volatility environment and whether price is respecting or violating its recent behavioral boundaries. Pairing this with momentum oscillators or volume analysis tends to work better than treating band breaks as standalone entries.

From an implementation perspective, the supertrend state machine tracks whether each direction's trail is active, handles resets when price breaks through, and manages the EMA smoothing on the trail points themselves rather than just post-processing the supertrend output. This means the smoothing is baked into the trailing logic, which creates a different response curve than if you just applied an EMA to a standard supertrend line. The angle calculations use RMS estimation for the delta normalization range, which adapts to changing volatility and keeps the color gradients responsive across different market conditions.

What this really demonstrates is that there are endless ways to combine basic technical concepts into something that feels fresh without reinventing mathematics. ATR offsets, trailing stops, EMA smoothing, and Donchian fills are all standard building blocks, but arranging them in a particular way produces behavior that's distinct from each component alone. Whether this particular arrangement works better than other volatility band systems depends entirely on your market, timeframe, and what you're trying to accomplish. For me, it scratched the itch I had from seeing Vector Flow years ago and wanting to build something in that same conceptual space using tools I'm more comfortable with.
Sürüm Notları
I forgot to add the center line haha.
Sürüm Notları
Updated Chart
Sürüm Notları
Hooked in the bg alpha

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.