VIDYA Strategy: Ride Trends, Sit Out the Chop

Most moving averages run at one speed. Markets don’t. A VIDYA strategy uses an average that changes pace with the market, so the trend line follows a real move closely and stays put in a dull range.
That matters most for crossover rules. A fixed average gets crossed again and again in sideways markets. Each cross is a trade, and most of them lose a little.
This guide builds a long-only adaptive trend strategy. For the indicator itself, read our Variable Index Dynamic Average guide.
The settings below are research starting points. They are not backtested recommendations or claimed results.
What Is a VIDYA Strategy?
A VIDYA strategy trades price against the Variable Index Dynamic Average (VIDYA). VIDYA is an exponential moving average whose speed changes on every candle. Tushar Chande introduced it in 1992.
The strategy has three jobs. Confirm a trend with VIDYA’s slope. Enter when price closes above the line. Exit when price closes back below it.
The adaptive speed is the whole point. In quiet markets the line barely moves. In active markets it keeps up with price.
How Does Arrow Algo’s VIDYA Block Set Its Speed?
Chande’s original version scaled speed with a momentum oscillator. Arrow Algo’s VIDYA block uses a common variant instead. It compares short-term volatility with long-term volatility. Tulip Indicators documents this version.
The block has three settings:
| Setting | Default | What it does |
|---|---|---|
| Short period | 10 | Window for recent volatility |
| Long period | 150 | Window for normal volatility |
| Alpha | 0.2 | Base smoothing speed |
Each candle, the block divides recent volatility by normal volatility. It multiplies that ratio by alpha. The result decides how far VIDYA moves towards the close.
A Worked Example
Say VIDYA sits at $60,000 and Bitcoin closes at $61,000. The gap is $1,000.
Quiet market. Recent volatility is half its normal level. The ratio is 0.5. Speed is 0.5 × 0.2 = 0.10. VIDYA moves 10% of the gap, to $60,100.
Waking market. Recent volatility is 1.5 times normal. Speed is 1.5 × 0.2 = 0.30. VIDYA moves 30% of the gap, to $60,300.
Same close, same gap. The line moved three times further because the market woke up.
Why the Speed Cuts Both Ways
Volatility rises in sell-offs too. VIDYA speeds up in a crash, not only in a rally. For a long-only strategy that helps. The line drops quickly, so the exit comes sooner.
The ratio can also exceed 1. In a sudden spike, VIDYA can move faster than alpha alone suggests. Expect it to hug price during violent candles.
Set the Strategy Rules
Use one liquid spot pair on one exchange feed. Start with completed four-hour candles. Keep everything fixed for the first comparison.
| Component | Illustrative rule |
|---|---|
| Trend | VIDYA above its own value 5 candles ago |
| Entry | Close crosses above VIDYA |
| Exit | Close crosses below VIDYA |
| Protective stop | Open trade down 6% |
| Direction | Long only |
The slope rule does the filtering. A flat VIDYA means the market is quiet. Crosses of a flat line carry little information. The slope rule ignores them.
What the Rules Leave Out
There is no fixed volatility threshold. VIDYA already reacts to volatility, so a second volatility filter would double-count it. Add one later only if the benchmark says you need it.
There is no take-profit either. Trend rules earn most of their money from a few long runs. A fixed target would cut those short.
Build the Strategy With Visual Blocks
Start with Data Watchers for your exchange, pair and four-hour timeframe. Supply closing prices.
The indicator-block documentation lists the VIDYA, Lag and Crossover blocks. Drag the VIDYA block onto the canvas. Connect closes to it. Leave the settings at 10, 150 and 0.2 for the first test.
Wire the Entry
Pass the VIDYA output through a Lag block set to 5. Compare VIDYA with its lagged value. VIDYA above the lag means the line is rising.
Add a Crossover block. Feed it closes and VIDYA. It fires when the close crosses above the line. Join the crossover and the slope comparison with an AND condition block.
Wire the Exits
Add a second Crossover block with the inputs reversed. It fires when the close drops below VIDYA.
Add a last-profit block and compare its output with -6. Join the crossover exit and the stop with an OR condition block.
Action Blocks express the buy and sell signals and their amounts. Confirm the amount units before testing.
Arrow Algo provides the no-code visual builder for these user-defined rules. If you choose deployment, your rules signal your own exchange account. The exchange decides whether to accept and execute.
How Should You Benchmark a VIDYA Strategy?
The key question is whether adaptive speed helps at all. So swap VIDYA for a plain 9-period EMA. Keep every other rule the same.
A 9-period EMA has a fixed speed of 0.2. That equals VIDYA’s speed when volatility sits at its normal level. That makes it a fair rival. Investopedia’s EMA guide explains the fixed-speed version.
Compare these numbers for both versions and for buy-and-hold:
- Net return after fees and slippage
- Maximum drawdown
- Number of completed trades
- Average profit per trade
- Share of trades that lost money
If VIDYA is doing its job, the trade count should fall. The average trade should improve. If both versions look the same, the adaptive speed adds nothing on that market.
Try Neighbouring Settings
Test alpha at 0.1 and 0.3. Test long periods of 100 and 200. Try daily candles as well as four-hour. A useful setting should have useful neighbours.
Fewer than 30 trades says very little. Add pairs before you trust a result.
Know Where It Struggles
Slow, steady trends are the weak spot. Volatility stays low, so VIDYA stays slow. Entries arrive late, and the line may lag well behind price.
Range breakouts can also fool it. Volatility jumps on the first big candle. VIDYA speeds up and price crosses. If the breakout fails, the exit follows quickly. That costs a small loss plus fees.
What Should You Take Into Your Next Backtest?
- VIDYA changes speed every candle. Arrow Algo’s block scales speed by recent versus normal volatility.
- A rising-slope rule filters out crosses of a flat, quiet line.
- Keep the first version simple: slope, cross in, cross out, one stop.
- Benchmark against a plain 9-period EMA with identical rules.
- Expect late entries in slow trends and quick exits in failed breakouts.
If the EMA version matches VIDYA, that is a useful answer. It means the simpler line was enough.
Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.
Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who've made the switch to systematic trading.
See Arrow Algo first on Google. Add us as a preferred source and our articles show up more in your Top Stories.
Add as a preferred source on Google