Variable Index Dynamic Average¶
Indicators · Moving Averages
Chande's Variable Index Dynamic Average — EMA whose speed scales with |CMO| volatility.
VIDYA — Chande's Variable Index Dynamic Average — is an EMA that speeds up when a market gets volatile and directional, and slows almost to a crawl when it goes quiet. Where a plain EMA always smooths at the same rate, VIDYA stretches and compresses its own smoothing bar by bar, so it hugs price during real moves and stops chasing noise in the dead zones. Think of it as an EMA with an automatic gearbox.
How it works¶
VIDYA starts from the normal EMA smoothing constant α = 2 / (Period + 1) (Period default 14) and then scales it by a volatility index k derived from the absolute Chande Momentum Oscillator over the CMO period (default 9). k runs from 0 to 1: in a strong, one-sided move it's near 1 (so VIDYA acts like a full-speed EMA(Period)), and in choppy two-sided trade it falls toward 0 (so the line barely moves). Each bar:
The Source defaults to close and the line plots on the price pane in your Line color. Because the rolling sums use a partial window at the start, there's no NaN warm-up — the line is drawn from the first bar.
When to use it¶
Reach for VIDYA when you want a trend line that automatically disengages in ranges. It's an alternative to KAMA: both are volatility-adaptive averages, but VIDYA keys its speed off momentum (CMO) rather than the efficiency ratio, which makes it react a touch faster to fresh directional thrusts. Use it as a bias line (above/below for long/short), a moving stop that flattens out in chop, or a smoother input to feed other logic. As with any adaptive MA, it still has to notice a regime change before it shifts gears, so it isn't instant on a hard reversal.
Example¶
Wire bars into VIDYA and use a price-vs-VIDYA cross as the trigger, but only while the line is actually moving: route price and VIDYA into a Crosses Above → Tester, then Tester. Because VIDYA flattens in ranges, most of the false crosses that plague a fixed EMA simply don't happen. Compare it side-by-side against a plain EMA of the same period to see the adaptivity.
Tips & gotchas¶
- Two periods, two jobs. Period sets the top speed (the EMA it relaxes toward); CMO period sets how twitchy the volatility gauge is. Tune CMO period first.
- Flat VIDYA = no conviction. A horizontal line means the volatility index has collapsed — treat it as "stand aside," same as a flat KAMA.
- Faster than KAMA on thrusts, but also a touch noisier — momentum reacts before efficiency does. Pick based on whether you value early entry or fewer whipsaws.
- No warm-up gap, so it's safe to wire straight into crosses from bar one.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| Source | bars / series |
Price bars or any indicator series |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| VIDYA | series |
Line | Volatility-adaptive moving average |
Parameters¶
| Parameter | Type | Default | What it does |
|---|---|---|---|
| Period | number · 2–500 | 14 |
EMA smoothing length (base alpha = 2/(period+1)) |
| CMO period | number · 2–400 | 9 |
Window for the |CMO| volatility index |
| Source | choice (close, open, high, low, hl2, hlc3, ohlc4) |
close |
|
| Line color | colour | #26c6da |
Reference auto-generated from the block catalog · category Indicators.