Variable Moving Average (VMA)
Page contents
The Variable Moving Average (VMA) is an advanced adaptive moving average developed by Tushar Chande, the same technical analyst who created the Chande Momentum Oscillator and VIDYA. The VMA differentiates itself from other moving averages by measuring and responding to price efficiency—how effectively price is moving in a particular direction compared to its overall volatility.
This adaptive capability allows the VMA to automatically become more responsive during strong trending markets and less sensitive during choppy, range-bound conditions, potentially giving traders more accurate signals across various market environments.
The Concept of Price Efficiency
At the heart of the VMA is the concept of price efficiency. Consider these two scenarios:
- A price that moves steadily from $100 to $110 in a straight line is 100% efficient
- A price that fluctuates wildly between $95 and $115 before finally settling at $110 is less efficient
The VMA quantifies this efficiency by comparing:
- The net directional movement (the direct distance from point A to point B)
- The total path traveled (summing all the intermediate price movements)
This ratio, called the Efficiency Ratio (ER), ranges from 0 to 1:
- Values near 1 indicate highly efficient, trending price movement
- Values near 0 indicate choppy, range-bound conditions
How VMA Works
The VMA implements a sophisticated adaptation mechanism based on price efficiency:
- Efficiency Calculation: The VMA calculates the Efficiency Ratio by dividing the magnitude of the net price change over a period by the sum of all absolute price changes within that period
- Dynamic Smoothing: The efficiency measure is used to determine a custom smoothing factor that ranges between fast and slow extremes
- Volatility Factor: The VMA implementation includes a VolFactor parameter that allows traders to adjust the sensitivity of the indicator to efficiency changes
- Adaptive Response: When price moves efficiently in one direction, the VMA behaves more like a fast moving average; when price moves inefficiently, it behaves more like a slow moving average
This dynamic adjustment helps the VMA reduce lag during strong trends while minimizing whipsaws during consolidations.
The Mathematics Behind VMA
Looking at the StrategyQuant implementation, the VMA calculation involves several key steps:
1. Calculate Price Direction (Net Change): netChange = |Price(today) - Price(Period days ago)| 2. Calculate Total Volatility: totalVolatility = Sum of |Price(day i) - Price(day i+1)| for Period days 3. Calculate Efficiency Ratio (ER): ER = netChange / totalVolatility (ranges from 0 to 1) 4. Determine Smoothing Constant: - Define fast period (2) and slow period (30) constants - Apply VolFactor to control sensitivity - SC = ER² * VolFactor - Scale between fast and slow EMA constants 5. Calculate VMA: VMA(today) = alpha * Price(today) + (1 - alpha) * VMA(yesterday) where alpha is the adaptive smoothing constant
The squared Efficiency Ratio (ER²) in step 4 emphasizes the difference between trending and non-trending conditions, making the VMA even more reactive to genuine trends.
Why Use VMA in Your Trading Systems?
The VMA offers several compelling advantages over traditional moving averages:
- Automatic Adaptation: Responds appropriately to both trending and ranging markets without parameter changes
- Reduced Lag in Trends: Becomes more responsive during strong directional moves
- Fewer False Signals: Becomes less sensitive during choppy market conditions
- Volatility Awareness: Understands the difference between meaningful and noisy price movements
- Customizable Sensitivity: The VolFactor parameter allows fine-tuning the adaptation mechanism
Implementing VMA in StrategyQuant
The StrategyQuant platform makes it straightforward to incorporate VMA into your trading strategies. The indicator accepts two primary parameters:
- Periodo: The lookback period for calculating efficiency (commonly 9, 14, 20, 50, or 200)
- VolFactor: Controls the sensitivity of adaptation (default is 2, higher values increase responsiveness)
StrategyQuant provides several pre-configured parameter sets for immediate testing:
- Period=9, VolFactor=2
- Period=14, VolFactor=2
- Period=20, VolFactor=2
- Period=50, VolFactor=2
- Period=200, VolFactor=2
- Period=14, VolFactor=4 (more responsive)
- Period=14, VolFactor=1 (less responsive)
Trading Strategies Using VMA
Here are some effective ways to leverage VMA in your trading systems:
1. VMA Crossover Systems
Use two VMA lines with different periods (e.g., VMA(14) and VMA(50)) to generate entry and exit signals. The adaptive nature of both lines can provide more timely signals compared to traditional moving average crossovers.
2. VMA Trend Direction
The slope of the VMA provides valuable information about trend strength and direction. A steepening slope often indicates increasing momentum, while a flattening slope may signal decreasing momentum.
3. VMA Support and Resistance
During trends, the VMA can function as dynamic support in uptrends or resistance in downtrends. Price pullbacks to the VMA line can offer potential entry opportunities with favorable risk-reward profiles.
4. VMA with Price Patterns
Combine VMA with chart patterns like triangles, flags, or head and shoulders. The VMA can help confirm whether the underlying trend supports the pattern’s expected resolution.
5. Multi-Timeframe VMA Analysis
Apply VMA across different timeframes to identify alignment between short, intermediate, and long-term trends. Trading in the direction of aligned VMAs across timeframes can improve success rates.
Optimizing VMA Parameters for Different Markets
While the default parameters work well across many instruments, customization can enhance VMA’s performance:
- Period Selection:
- Shorter periods (9-14): More suitable for short-term trading
- Medium periods (20-50): Effective for swing trading
- Longer periods (200+): Better for position trading and major trend identification
- VolFactor Adjustment:
- Higher values (3-5): Increase responsiveness to efficiency changes, better for volatile markets
- Lower values (0.5-1.5): Decrease responsiveness, better for more stable instruments
- Default (2): Balanced approach suitable for most conditions
VMA vs. VIDYA: Understanding the Differences
Both VMA and VIDYA are adaptive moving averages created by Tushar Chande, but they use different mechanisms to adjust:
- VMA adapts based on price efficiency (directional movement relative to volatility)
- VIDYA adapts based on the Chande Momentum Oscillator (measures momentum strength)
In practice, VMA often excels at identifying persistent trends while filtering out noise, while VIDYA can be more responsive to shorter-term momentum shifts. Many sophisticated traders use both indicators for confirmation or in different market contexts.
Indicator Availability:
This indicator is implemented for MT4, MT5, TradeStation, and MultiCharts.
Using Custom Blocks for Conditions:
You can easily define your own conditions in StrategyQuant X using Bloques personalizados. This allows you to set up parameters such as periods or steps to fine-tune the indicator to your strategy. For more detailed information, refer to the following resources:
Importing Custom Indicators into SQX:
To import custom indicators into StrategyQuant X, follow the step-by-step instructions provided here:
Import & Export Custom Indicators and Other Snippets