Volatility Aggregation Model Tradingview
Volatility Aggregation Model (VAM) is a very simple overlay indicator that classifies market direction using a five-speed ensemble of volatility-adaptive range engines. Instead of relying on a single trend filter, VAM evaluates direction across multiple responsiveness settings and converts those states into a normalized score
Introduction
Uptrick: Volatility Aggregation Model (VAM) is a very simple overlay indicator that classifies market direction using a five-speed ensemble of volatility-adaptive range engines. Instead of relying on a single trend filter, VAM evaluates direction across multiple responsiveness settings and converts those states into a normalized score. The script then uses configurable score thresholds to define bullish, bearish, and neutral regimes, and it visualizes those regimes directly on the chart through candle recoloring and optional Up/Down labels.
Overview
VAM is built around an ensemble concept: five independent “speed” layers each determine a directional state by testing whether price breaks above or below a volatility-defined band. The five states are combined into a single score ranging from -1.0 (fully bearish across all speeds) to +1.0 (fully bullish across all speeds). This score is compared to user-defined buy and sell thresholds to determine regime. For visual context, the indicator also plots directional trail layers derived from the middle speed for stability, and can optionally fill the space between trail layers to make regime changes easier to spot at a glance.
Originality and value
This script’s originality comes from how it frames direction as a consensus problem rather than a single-indicator outcome. Each speed layer uses a volatility range defined from true range smoothing and applies a breakout-based state flip using upper and lower bands. Because the layers differ in lookback length, volatility scaling, band width, and smoothing, they respond differently to the same price movement. Aggregating them into a normalized score creates a compact, interpretable measure of directional agreement that can be tuned to be more selective or more permissive using thresholds. The result is a regime tool that is transparent, parameterized, and suitable for traders who want a directional filter that adapts to volatility and avoids treating all market conditions as equally “trendable.”
How it works
- Start date gating
The script includes a start date filter that can be used to restrict when labels (and any signal interpretation) begin. Bars before the start date will still plot normally, but Up/Down labels are suppressed until the chart time is greater than or equal to the configured start date. - Five-speed volatility range engines
Each of the five speeds computes:
➜ A volatility measure based on true range (TR), smoothed with an EMA over the speed’s length, then scaled by a speed-specific volatility multiplier.
➜ An internal center line that “snaps” toward price only when price moves beyond the current volatility allowance. When price movement is smaller than the allowance, the center remains unchanged.
➜ Upper and lower bands around the center, spaced by the volatility allowance multiplied by a speed-specific band multiplier, then smoothed.
➜ A directional side state:
━━━━➤ Side flips bullish when source crosses above the upper band.
━━━━➤ Side flips bearish when source crosses below the lower band. This breakout-only flip logic is fixed in the script (no center-cross mode), so direction changes occur only when price breaks out of the band envelope. - Ensemble scoring
The five side states are summed and divided by 5 to produce a normalized ensemble score:
➜ +1.0 means all five speeds are bullish.
➜ -1.0 means all five speeds are bearish.
➜ Values between reflect partial agreement and mixed conditions.
The script then classifies the current regime using your thresholds:
➜ Bullish regime when score is greater than the buy threshold.
➜ Bearish regime when score is less than the sell threshold.
➜ Neutral regime otherwise. - Signals
Signals are generated from score crossing events:
➜ A buy signal occurs when the score crosses over the buy threshold.
➜ A sell signal occurs when the score crosses under the sell threshold.
These signals are used for labels (if enabled) and alert conditions. They are not strategy orders and do not simulate fills. - Visual system: trails, ATR layer, and fill
For stability, the trail structure is derived from the middle speed (Speed 3). The script computes smoothed lower and upper bands from Speed 3 as internal reference levels.It then plots ATR-offset layers based on true range smoothed over the ATR Layer Length and scaled by the ATR Layer Mult. The bullish ATR layer is positioned below the Speed 3 lower band, and the bearish ATR layer is positioned above the Speed 3 upper band.
These ATR-offset layers are the primary visible trail elements. Optional fill appears between each reference band and its ATR layer only during the active bullish or bearish regime.
The script can optionally fill between the trail and ATR layer lines, but only in the corresponding regime:
➜ Bull fill appears only when the regime is bullish.
➜ Bear fill appears only when the regime is bearish.
Neutral conditions suppress the regime fill emphasis. - Candle recoloring
The indicator uses plotcandle to recolor candles based on the current regime:
➜ Bull color when bullish regime is active.
➜ Bear color when bearish regime is active.
➜ Neutral gray when neither threshold condition is met.
This makes regime identification possible without relying on separate panels.
Inputs and how to use them
Plot group
Start Date
Defines the earliest chart time at which labels and signal annotations are allowed. This is useful for limiting label clutter when reviewing long history or when you only want signals after a certain market regime, contract listing date, or personal testing period.
Ensemble group
Buy Threshold
A score level above which the script considers the market bullish. Higher values make bullish classification more selective because more of the five speeds must agree bullishly. Lower values allow bullish classification with weaker consensus.
Sell Threshold
A score level below which the script considers the market bearish. More negative values make bearish classification more selective. Values closer to zero will classify bearish regimes more readily.
Show Up/Down Labels
Toggles the display of directional labels on threshold cross events. When enabled, labels are only printed on bars at or after the Start Date, and only when score crosses the relevant threshold (not merely when it remains above or below).
Visuals group
Fill Between Trail Layers
Enables or disables the filled region between each trail and its ATR layer. When disabled, trail lines can still be visible (depending on the regime) but the emphasis fill is removed.
Trail Smooth
Controls EMA smoothing applied to the trail lines and their ATR-offset layers. Higher values produce smoother, slower-reacting trails; lower values make trails respond more quickly but can increase visual noise.
ATR Layer Length
Controls the EMA length used to smooth true range for the ATR-style layer. Larger values produce a steadier ATR layer; smaller values track volatility changes more quickly.
ATR Layer Mult
Scales the ATR layer offset distance from the trail. Increasing this value expands the buffer around the trail; decreasing it tightens the buffer.
Colors group
Bull
Sets the color used for bullish candles, bullish trail visuals, and bullish label styling.
Bear
Sets the color used for bearish candles, bearish trail visuals, and bearish label styling.
Neutral Gray
Sets the candle color used when the score is between thresholds (neutral regime).
5 Speeds group
Source
Chooses the price series used for band breakouts and side calculations (default close). Changing the source changes what the engines consider the breakout trigger. For example, using hl2 or ohlc4 can reduce sensitivity to closes alone, while using close keeps breakouts tied to settlement values.
Speed 1 Length, Speed 2 Length, Speed 3 Length, Speed 4 Length, Speed 5 Length
These define the EMA length used to smooth true range for each speed’s volatility allowance. Smaller lengths typically react faster to volatility changes; larger lengths smooth volatility more.
Speed 1 Vol Mult through Speed 5 Vol Mult
These scale the volatility allowance for each speed. Increasing a speed’s volatility multiplier makes its center and bands more tolerant to price movement, which can reduce how often that layer flips direction. Decreasing it tightens the allowance, potentially increasing flip frequency.
Speed 1 Band Mult through Speed 5 Band Mult
These control how far bands are placed from the center relative to the volatility allowance. Higher band multipliers widen bands (requiring larger breakouts to flip side). Lower band multipliers narrow bands (making flips easier to trigger).
Speed 1 Smooth through Speed 5 Smooth
These apply EMA smoothing to the volatility allowance and the band outputs for each speed. Higher smoothing reduces jitter and slows reaction; lower smoothing increases responsiveness.
Alerts
The script provides two alert conditions:
- Ensemble Buy: triggers when the score crosses above the buy threshold.
- Ensemble Sell: triggers when the score crosses below the sell threshold.
These alerts correspond directly to the label events (when labels are enabled), but alerts can be used independently of label visibility.
Trail
The trail in Uptrick: Volatility Aggregation Model (VAM) acts as a dynamic support and resistance band derived from the middle engine (Speed 3) for stability. In bullish regimes, the lower trail functions as volatility-adjusted support. During a long trade, stops can be positioned below this band, and pullbacks into the trail while the regime remains bullish may be treated as opportunities to add to the position.
In bearish regimes, the upper trail functions as volatility-adjusted resistance. During a short trade, stops can be placed above the band, and rallies back into the trail while the regime remains bearish may be considered potential add-on zones.
The trail is designed for trade management and structural guidance within the ensemble-defined regime, not as a standalone entry signal.
Summary
Uptrick: Volatility Aggregation Model (VAM) is a volatility-adaptive, five-speed ensemble direction indicator that converts multiple breakout-based range states into a single normalized score. You control regime sensitivity using buy/sell score thresholds, and you can visualize regimes through candle recoloring, optional labels, and trail layers derived from the middle speed plus an ATR-based buffer. The indicator is designed to help traders interpret directional agreement across multiple responsiveness settings and to mark regime transitions when score crosses the chosen thresholds.
Disclaimer
This indicator is for informational and educational purposes only and does not constitute financial advice. Trading involves risk, and you are responsible for your own decisions. Past performance and historical signals do not guarantee future results.
Related Products
Dual Structural Trendline Fib Channel Free Download
Dual Structural Trendline Fib Channel is a structural analysis indicator that automatically constructs dual trendline channels using pivot-based slope logic.
Wedge Pattern [InfinityAlgo] Free Download
Wedge Pattern is a chart overlay that detects rising and falling wedge formations using strict pivot based rules and a validation engine that enforces classic technical analysis requirements. The script builds two trendlines from confirmed pivot highs and pivot lows
Quantum Emperor MT4 Free Download
Introducing Quantum Emperor EA, the groundbreaking MQL5 expert advisor that's transforming the way you trade the prestigious GBPUSD pair! Developed by a team of experienced traders with trading experience of over 13 years.
CyNera MT4 Free Download
Trading gold, one of the most volatile instruments in the market, demands precision, in-depth analysis, and strong risk management. CyNera Expert Advisor seamlessly integrates these elements into a sophisticated system designed for optimal gold trading.
AI Gold Scalp Pro Free Download
Meet AI Gold Scalp Pro: The Self-Learning Scalper That Turns Losses into Lessons. Most scalping EAs hide from their mistakes. AI Gold Scalp Pro learns from them.
