PROTECTED SOURCE SCRIPT
Trinity Adaptive Volatility Bands

This is an update on this script. tradingview.com/v/AddrGn5u/$0 and author: tradingview.com/u/AlphaNatt/$0 and full credit to him for his wonderful source code and making it also available here.
What stayed the same (core idea & logic):
Adaptive volatility bands around a central basis
Basis can be SMA / EMA / ALMA / KAMA / VWMA
Volatility source can be ATR / Stdev / Range
Adaptive multiplier that widens bands in strong trends
TTM-style squeeze detection (Bollinger inside Keltner)
Expansion detection
Trend-state tracking (bullish vs bearish coloring)
Long/short signals when price crosses the basis while basis is sloping
Beautiful gradient fill concept
What Changed:
1. Fixed → now both upper and lower zones always glow with the correct trend color (cyan in bull, magenta in bear)
2. Replaced with dynamic proportional steps (always exactly 10 equal layers regardless of band width) → perfect glow every time
3. Used switch … => syntax in some places that caused compile errors in v6. Replaced all with clean if / ternary or proper switch without arrows
4. Long/short trend state used => inside if (syntax error). Fixed to trend := 1 / trend := -1
5. Added fully grouped settings with clear names and tooltips explaining every single option
6. Made every color 100% customizable (bull, bear, neutral, squeeze bg, expansion bg)
7. Added optional blue & pink background tint so you instantly see the squeeze fire without needing another indicator
8. Added visible BUY/SELL triangles with text on chart which can be disabled
Summary of Trinity Adaptive Volatility Bands [Final Version]
This indicator is a highly visual, smart, and fully self-contained volatility band system that combines the best ideas from Bollinger Bands, Keltner Channels, ALMA/KAMA, and the famous TTM Squeeze into one clean, glowing package. It dynamically widens and narrows the bands according to real-time trend strength, paints the entire area between the bands with a beautiful 10-layer gradient (cyan in uptrends, magenta in downtrends), and instantly tells you when the market is extremely quiet (squeeze) or exploding into a big move (expansion).
It is designed for swing traders, day traders, and scalpers who want a single indicator that shows trend direction, volatility state, and high-probability entries without needing ten other tools on the chart.
How to read and use it
The thick middle line (Basis) is an adaptive moving average (default ALMA – very smooth and low-lag).
→ When it is cyan = confirmed uptrend
→ When it is magenta = confirmed downtrend
→ Gray = neutral / ranging
The glowing area around the basis is the adaptive volatility envelope.
The stronger the trend, the wider the bands become automatically (no manual tweaking needed most of the time).
Long signal (green triangle + “BUY”): price closes above the basis while the basis itself is rising → fresh bullish momentum confirmed.
Short signal (red triangle + “SELL”): price closes below the basis while the basis is falling → fresh bearish momentum confirmed.
Blue subtle background = Squeeze is ON
This means volatility has collapsed to extreme lows (Bollinger Bands are inside Keltner Channel).
Statistically one of the highest-probability setups for a big move in either direction. Prepare, do NOT trade the chop inside the squeeze.
Pink/red flash background = Expansion just started
The squeeze has fired, volatility is exploding, and a strong directional move is usually already underway. This is often where the real money is made.
Best ways to trade it
Classic breakout: wait for a squeeze (blue background) → enter on the first strong close outside the bands in the direction of the new trend color.
Trend continuation: after a squeeze fires, simply take every pullback to the basis in the direction of the dominant color (cyan = long only, magenta = short only).
Aggressive scalping: enter immediately on the BUY/SELL triangles with tight stop below/above the opposite band.
Filter with higher timeframe: use the same indicator on 4H/Daily to only take 1H or lower signals that agree with the bigger trend color.
Quick settings tips
Leave everything at defaults → works fantastic on almost any market and timeframe.
Want tighter bands? → lower “Base Multiplier” to 1.5–1.8.
Want even smoother basis? → keep ALMA selected and raise “ALMA Sigma” to 8–10.
Trading very choppy markets? → turn “Enable Adaptive Bands” OFF for fixed-width classic behavior.
Want it to match your chart theme? → change Bullish/Bearish colors in the “Colors” group.
In short: when the chart glows cyan and price is above the basis → be long-biased. When it glows magenta and price is below → be short-biased. Blue background = get ready. Pink flash = the move is on. That’s really all you need to know to trade profitably with this indicator.
What stayed the same (core idea & logic):
Adaptive volatility bands around a central basis
Basis can be SMA / EMA / ALMA / KAMA / VWMA
Volatility source can be ATR / Stdev / Range
Adaptive multiplier that widens bands in strong trends
TTM-style squeeze detection (Bollinger inside Keltner)
Expansion detection
Trend-state tracking (bullish vs bearish coloring)
Long/short signals when price crosses the basis while basis is sloping
Beautiful gradient fill concept
What Changed:
1. Fixed → now both upper and lower zones always glow with the correct trend color (cyan in bull, magenta in bear)
2. Replaced with dynamic proportional steps (always exactly 10 equal layers regardless of band width) → perfect glow every time
3. Used switch … => syntax in some places that caused compile errors in v6. Replaced all with clean if / ternary or proper switch without arrows
4. Long/short trend state used => inside if (syntax error). Fixed to trend := 1 / trend := -1
5. Added fully grouped settings with clear names and tooltips explaining every single option
6. Made every color 100% customizable (bull, bear, neutral, squeeze bg, expansion bg)
7. Added optional blue & pink background tint so you instantly see the squeeze fire without needing another indicator
8. Added visible BUY/SELL triangles with text on chart which can be disabled
Summary of Trinity Adaptive Volatility Bands [Final Version]
This indicator is a highly visual, smart, and fully self-contained volatility band system that combines the best ideas from Bollinger Bands, Keltner Channels, ALMA/KAMA, and the famous TTM Squeeze into one clean, glowing package. It dynamically widens and narrows the bands according to real-time trend strength, paints the entire area between the bands with a beautiful 10-layer gradient (cyan in uptrends, magenta in downtrends), and instantly tells you when the market is extremely quiet (squeeze) or exploding into a big move (expansion).
It is designed for swing traders, day traders, and scalpers who want a single indicator that shows trend direction, volatility state, and high-probability entries without needing ten other tools on the chart.
How to read and use it
The thick middle line (Basis) is an adaptive moving average (default ALMA – very smooth and low-lag).
→ When it is cyan = confirmed uptrend
→ When it is magenta = confirmed downtrend
→ Gray = neutral / ranging
The glowing area around the basis is the adaptive volatility envelope.
The stronger the trend, the wider the bands become automatically (no manual tweaking needed most of the time).
Long signal (green triangle + “BUY”): price closes above the basis while the basis itself is rising → fresh bullish momentum confirmed.
Short signal (red triangle + “SELL”): price closes below the basis while the basis is falling → fresh bearish momentum confirmed.
Blue subtle background = Squeeze is ON
This means volatility has collapsed to extreme lows (Bollinger Bands are inside Keltner Channel).
Statistically one of the highest-probability setups for a big move in either direction. Prepare, do NOT trade the chop inside the squeeze.
Pink/red flash background = Expansion just started
The squeeze has fired, volatility is exploding, and a strong directional move is usually already underway. This is often where the real money is made.
Best ways to trade it
Classic breakout: wait for a squeeze (blue background) → enter on the first strong close outside the bands in the direction of the new trend color.
Trend continuation: after a squeeze fires, simply take every pullback to the basis in the direction of the dominant color (cyan = long only, magenta = short only).
Aggressive scalping: enter immediately on the BUY/SELL triangles with tight stop below/above the opposite band.
Filter with higher timeframe: use the same indicator on 4H/Daily to only take 1H or lower signals that agree with the bigger trend color.
Quick settings tips
Leave everything at defaults → works fantastic on almost any market and timeframe.
Want tighter bands? → lower “Base Multiplier” to 1.5–1.8.
Want even smoother basis? → keep ALMA selected and raise “ALMA Sigma” to 8–10.
Trading very choppy markets? → turn “Enable Adaptive Bands” OFF for fixed-width classic behavior.
Want it to match your chart theme? → change Bullish/Bearish colors in the “Colors” group.
In short: when the chart glows cyan and price is above the basis → be long-biased. When it glows magenta and price is below → be short-biased. Blue background = get ready. Pink flash = the move is on. That’s really all you need to know to trade profitably with this indicator.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.