VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime

VIDYA: a moving average that only hurries when price does

VIDYA is an exponential moving average with a variable speed. When price pushes hard in one direction the line follows closely. When price drifts sideways it nearly stops, which is why VIDYA stays flat through chop while an ordinary average keeps wobbling.

FamilyTrend
OutputAdaptive line drawn over priceSame units as price
In AlphaPrimeCustom indicatorNot a built-in generator family

What it measures

An ordinary exponential average moves a fixed share of the way toward each new close. VIDYA changes that share bar by bar, using a throttle: how much of the recent movement went one way, compared with all the movement.

The formula in words: each bar, VIDYA starts from its previous value and moves toward the new close by a share of the gap. That share is the weight of a normal exponential average of your chosen length (two divided by the length plus one), scaled down by a throttle. The throttle compares the up-moves and down-moves in the lookback window: take the sum of up-moves minus the sum of down-moves, ignore the sign, and divide by the sum of both. Up-moves are the amounts closes rose from the bar before, down-moves the amounts they fell. If every bar rose, the throttle is one and VIDYA acts like the plain exponential average. If ups and downs cancel, the throttle sits near zero and the line barely moves.

So VIDYA never runs ahead of its exponential twin. It can only be slower.

Concept sketch (not real market data)

How it behaves in real markets

In a clean trend on ES the line tracks price almost as tightly as a short exponential average. In a range it goes flat. That makes it a good filter and a poor trigger: when a new trend starts, VIDYA is late, because the throttle only opens once the move is under way.

A single gap bends it less than you might expect. The gap counts as one up-move or down-move in the ratio, not as a run of them.

Common ways to use it (concepts)

Trend filter

Trade only while the line is tilted

Allow longs while VIDYA rises and shorts while it falls, and stand aside while it is flat. The flat stretches are the ranges where trend rules bleed.

Slope change

A flat line that starts to turn

After a long flat stretch, the first clear tilt is easy to spot. The catch is timing: it shows up after the breakout bar, not on it.

Price versus line

Pullbacks inside a running trend

Once the line is moving, pullbacks toward it work like pullbacks to any trend average, with the touch coming a little sooner.

Pairing it with other indicator families

VIDYA already carries its own chop filter, so adding the Choppiness Index or ADX mostly asks the same question twice. I'd pair it with something that measures size instead: ATR for stops, or Bollinger Bands to see whether a tilt starts out of a squeeze.

KAMA is its closest relative. Test one against the other rather than stacking them.

In AlphaPrime

AlphaPrime doesn't ship VIDYA as a built-in generator family. You can add it as a custom indicator: ask the AI to add it, and once installed it appears under Custom indicators, where the strategy generator can use it as an entry, exit or filter rule.

Start with the throttle window equal to the average length and put KAMA in the same run, so the two adaptive lines compete on the same bars. AlphaPrime comes with a free seven-day trial.

FAQ

Is VIDYA the same as KAMA?

No. Both slow down in sideways markets, but VIDYA sets its speed from the balance of up-moves and down-moves, while KAMA compares how far price travelled with how much it wandered.

Which length should I use for VIDYA?

There isn't a right one. Let the generator try a range of lengths and keep what still works out of sample.

Why does VIDYA go completely flat sometimes?

The ups and downs in its window cancel out, which drives the throttle close to zero. Flat means the recent movement had no direction.