vidya

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.vidya(source: ArrayLike,period_cmo: int = 9,period_ema: int = 12) -> np.ndarray

Chande's variable index dynamic average.

Parameters

NameTypeDefault
sourceArrayLike
period_cmoint9
period_emaint12

Indicator: Variable index dynamic average

alpha = 2 / (period_ema + 1) * |CMO| with CMO the Chande momentum over period_cmo bars, then VIDYA = price * alpha + previous * (1 - alpha). NaN for the first period_ema + period_cmo - 1 bars of each unbroken run.

Classpython
forge.ta.VIDYA(**inputs: Any) -> None

Exponential average that speeds up when momentum is strong.

Inputs

NameTypeDefaultRange
sourcesourceclose
period_cmoint91 to 5000
period_emaint121 to 5000

CMO = (sum of up moves - sum of down moves) / (sum of up moves + sum of down moves) over period_cmo bars

alpha = 2 / (period_ema + 1) * |CMO|

VIDYA[i] = x[i] * alpha + VIDYA[i-1] * (1 - alpha)

After a gap the average starts again.