Adaptive Volatility Trend [WillyAlgoTrader]Adaptive Volatility Trend (AVT) is a trend-following overlay indicator that dynamically adjusts its sensitivity to market conditions using the Kaufman Efficiency Ratio and ATR-based volatility bands.
Unlike static moving averages or fixed-width channels, AVT continuously adapts: it accelerates in strong directional moves and slows down during choppy, range-bound price action — reducing whipsaws where most trend indicators fail.
🔍 WHAT MAKES IT ORIGINAL
The core innovation is a self-tuning mechanism built on three adaptive layers:
1. Kaufman Efficiency Ratio (ER) as an adaptive engine. The ER measures how "efficient" price movement is — the ratio of net directional change to total path traveled over N bars. An ER near 1.0 means price moved in a clean straight line (strong trend); near 0.0 means it went sideways with lots of noise. AVT uses the smoothed ER to dynamically blend between a fast constant (2-period EMA speed) and a slow constant (30-period EMA speed), producing an Adaptive Moving Average that responds quickly in trends and becomes sluggish in chop.
2. ER-scaled ATR bands. The volatility channel doesn't just use raw ATR × multiplier. It incorporates the Efficiency Ratio to narrow the bands during trending conditions (where ER is high) and widen them during ranging markets (where ER is low). This means the channel contracts when the trend is clean — keeping signals tight — and expands when price is noisy — filtering out false breakouts.
3. Composite Signal Scoring System (0–100). Every signal receives a quality score based on three weighted components:
— Trend strength (0–40 pts): derived from the Efficiency Ratio magnitude
— Momentum (0–30 pts): RSI distance from the neutral 50-level in the signal direction
— Volume confirmation (0–30 pts): current volume relative to its 20-period average
Only signals exceeding the user-defined minimum score threshold are displayed — letting you filter out low-conviction setups.
⚙️ HOW IT WORKS
Trend detection:
The indicator calculates an Adaptive Moving Average using the Kaufman method. The slope of this line determines trend direction: if the line rises by more than 5% of current ATR, the trend is classified as bullish; if it falls by the same threshold, bearish. A small dead zone (ATR × 0.05) prevents noise from flipping the trend.
Signal generation:
A BUY signal fires when:
— Trend flips from bearish/neutral to bullish (slope turns positive)
— Price is above the adaptive line
— RSI is not in overbought territory (if RSI filter is enabled)
— Volume exceeds its moving average × threshold (if volume filter is enabled; auto-disabled on forex)
— Composite score meets the minimum threshold
— Bar is confirmed (close-based, no repainting)
SELL signals use the mirror logic.
Anti-repaint compliance:
All signals require barstate.isconfirmed — they only trigger on the close of the bar and never change on historical data. A warmup period (minimum 50 bars or 2× Trend Length) prevents unreliable early signals.
Volume filter on forex:
The indicator automatically detects instruments with no volume data (common on forex pairs) and bypasses the volume filter for those symbols, so it works seamlessly across asset classes.
📖 HOW TO USE
Reading the chart:
— Green trend line + upward slope = bullish regime
— Red trend line + downward slope = bearish regime
— Yellow trend line = neutral / transitioning
— ▲ labels below bars = confirmed BUY signal
— ▼ labels above bars = confirmed SELL signal
— The shaded channel around the trend line shows volatility-adjusted support/resistance zones
Quick-start presets:
— Conservative (Length 30 / ATR 20 / Mult 2.5): fewer signals, higher reliability — suited for swing trading on 4H–Daily
— Default (Length 20 / ATR 14 / Mult 2.0): balanced for most timeframes
— Aggressive (Length 12 / ATR 10 / Mult 1.5): more signals — suited for 15min–1H
— Scalping (Length 8 / ATR 7 / Mult 1.2): fast response — optimized for 1–5min charts
Signal quality:
Use the Score value in the dashboard to gauge conviction:
— 70–100: strong trend + momentum + volume alignment
— 40–69: moderate setup, consider additional confluence
— Below threshold: signal filtered out (not shown)
Dashboard panel:
Displays current trend direction, last signal with its score, Efficiency Ratio %, RSI value, timeframe, and indicator version. Position is adjustable to any corner of the chart.
Alerts & automation:
Supports both standard TradingView alert messages and JSON webhook format for integration with 3Commas, Alertatron, or custom bots. Alert messages include ticker, price, timeframe, and signal score.
⚙️ KEY SETTINGS REFERENCE
— Trend Length (default 21): lookback for adaptive MA — higher = smoother, lower = faster
— ATR Length (default 14): period for volatility bands — higher = wider bands
— Band Multiplier (default 2.0): ATR multiplier for channel width — higher = fewer false signals
— RSI Filter (on by default): blocks buy signals when RSI > 70, sell signals when RSI < 30
— Volume Filter (on by default): requires volume > SMA(20) × 1.2 — auto-disabled on forex
— Min Signal Score (default 40): minimum composite score for signal display
— Efficiency Smoothing (default 5): EMA smoothing of the Kaufman ER
⚠️ IMPORTANT NOTES
— This indicator does not use future data. No lookahead, no repainting.
— Past performance shown on any chart does not guarantee future results.
— AVT is a tool for identifying trend direction and generating signal candidates — it is not a complete trading system. Always use proper risk management and consider additional confluence before entering trades.
— The indicator works best in trending markets. In prolonged sideways conditions, even filtered signals may produce whipsaws — the Efficiency Ratio in the dashboard helps you assess whether the current market is trending enough for signal reliability.
Pine Script® indicator






















