vidya
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.vidya(source: ArrayLike,period_cmo: int = 9,period_ema: int = 12) -> np.ndarrayChande's variable index dynamic average.
Parameters
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| period_cmo | int | 9 |
| period_ema | int | 12 |
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) -> NoneExponential average that speeds up when momentum is strong.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period_cmo | int | 9 | 1 to 5000 |
| period_ema | int | 12 | 1 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.