OPEN-SOURCE SCRIPT
Adaptive Volatility Bands [I.M]

Adaptive Volatility Bands [I.M]
A clean, directional volatility envelope that visually highlights the dominant side of the market. Instead of showing bands on both sides at once, AVB displays a single trailing gradient band that flips with the trend — acting as dynamic support during uptrends and dynamic resistance during downtrends.
▶ HOW IT WORKS
1. CENTER LINE
A double-smoothed baseline (WMA → EMA) defines the underlying trend. Its slope determines whether the market is in bullish or bearish mode.
2. TRAILING BAND
A single ATR-based band is plotted on the dominant side:
- Uptrend → band sits BELOW price (support zone)
- Downtrend → band sits ABOVE price (resistance zone)
3. GRADIENT FILL
The space between the trailing band and price is filled with 8 progressive transparency layers, creating a smooth gradient that fades toward the candles. This makes the trend visually unambiguous at a glance.
▶ HOW TO USE IT
The core principle is simple: TRADE WITH THE BAND, NEVER AGAINST IT.
When the band is GREEN (below price):
- The market is in an uptrend
- Look for LONG entries on pullbacks toward the band
- The trailing band acts as a dynamic stop-loss reference
- Avoid shorting until the band flips to red above price
When the band is RED (above price):
- The market is in a downtrend
- Look for SHORT entries on rallies toward the band
- The trailing band acts as a dynamic stop-loss reference
- Avoid longs until the band flips to green below price
TREND FLIPS: When the band switches sides, treat it as a regime change. Wait for confirmation (a clean close on the new side) before committing — the first bars after a flip are noisy.
▶ SETTINGS
- Length / Smoothing: control baseline responsiveness
- ATR Length: volatility lookback for band distance
- Band Distance (ATR): how far the band sits from the baseline (default 2.0)
- Gradient Layers: smoothness of the fill (3–15)
- Up / Down Colors: fully customizable
▶ ALERTS
- Bullish / Bearish baseline crosses
- Trend flip to bullish / bearish
▶ NOTES
This indicator is a visual trend filter, not a standalone signal generator. It works best when combined with momentum or volume confirmation. The unilateral design is intentional — it forces directional discipline and discourages counter-trend trading.
Open-source. Feedback and forks welcome.
A clean, directional volatility envelope that visually highlights the dominant side of the market. Instead of showing bands on both sides at once, AVB displays a single trailing gradient band that flips with the trend — acting as dynamic support during uptrends and dynamic resistance during downtrends.
▶ HOW IT WORKS
1. CENTER LINE
A double-smoothed baseline (WMA → EMA) defines the underlying trend. Its slope determines whether the market is in bullish or bearish mode.
2. TRAILING BAND
A single ATR-based band is plotted on the dominant side:
- Uptrend → band sits BELOW price (support zone)
- Downtrend → band sits ABOVE price (resistance zone)
3. GRADIENT FILL
The space between the trailing band and price is filled with 8 progressive transparency layers, creating a smooth gradient that fades toward the candles. This makes the trend visually unambiguous at a glance.
▶ HOW TO USE IT
The core principle is simple: TRADE WITH THE BAND, NEVER AGAINST IT.
When the band is GREEN (below price):
- The market is in an uptrend
- Look for LONG entries on pullbacks toward the band
- The trailing band acts as a dynamic stop-loss reference
- Avoid shorting until the band flips to red above price
When the band is RED (above price):
- The market is in a downtrend
- Look for SHORT entries on rallies toward the band
- The trailing band acts as a dynamic stop-loss reference
- Avoid longs until the band flips to green below price
TREND FLIPS: When the band switches sides, treat it as a regime change. Wait for confirmation (a clean close on the new side) before committing — the first bars after a flip are noisy.
▶ SETTINGS
- Length / Smoothing: control baseline responsiveness
- ATR Length: volatility lookback for band distance
- Band Distance (ATR): how far the band sits from the baseline (default 2.0)
- Gradient Layers: smoothness of the fill (3–15)
- Up / Down Colors: fully customizable
▶ ALERTS
- Bullish / Bearish baseline crosses
- Trend flip to bullish / bearish
▶ NOTES
This indicator is a visual trend filter, not a standalone signal generator. It works best when combined with momentum or volume confirmation. The unilateral design is intentional — it forces directional discipline and discourages counter-trend trading.
Open-source. Feedback and forks welcome.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。