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