Skip to content

IIndicatorsAccessor.VariableIndexDynamicAverage

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The Variable Index Dynamic Average (VIDYA) indicator is a type of moving average that dynamically adjusts its smoothing period based on market volatility.

Overloads

VariableIndexDynamicAverage(DataSeries source, int cmoPeriods, int smoothPeriods)

The Variable Index Dynamic Average (VIDYA) indicator is a type of moving average that dynamically adjusts its smoothing period based on market volatility.

VariableIndexDynamicAverage VariableIndexDynamicAverage(DataSeries source, int cmoPeriods, int smoothPeriods)
api.Indicators.VariableIndexDynamicAverage(source: DataSeries, cmoPeriods: int, smoothPeriods: int) -> VariableIndexDynamicAverage

Parameters

Name C# type Python type Description
source DataSeries DataSeries The source data used for calculation.
cmoPeriods int int The value of the periods used for the Chande Momentum Oscillator (CMO) calculation.
smoothPeriods int int The value of the periods used for the volatility smoothing factor calculation.

Returns VariableIndexDynamicAverage

Examples

var vidya = Indicators.VariableIndexDynamicAverage(Bars.ClosePrices, 9, 12);
Print("VIDYA(9, 12): {0}", vidya.Result.LastValue);
vidya = api.Indicators.VariableIndexDynamicAverage(api.Bars.ClosePrices, 9, 12)
api.Print(f"VIDYA(9, 12): {vidya.Result.LastValue}")

VariableIndexDynamicAverage(int cmoPeriods, int smoothPeriods)

The Variable Index Dynamic Average (VIDYA) indicator is a type of moving average that dynamically adjusts its smoothing period based on market volatility.

VariableIndexDynamicAverage VariableIndexDynamicAverage(int cmoPeriods, int smoothPeriods)
api.Indicators.VariableIndexDynamicAverage(cmoPeriods: int, smoothPeriods: int) -> VariableIndexDynamicAverage

Parameters

Name C# type Python type Description
cmoPeriods int int The value of the periods used for the Chande Momentum Oscillator (CMO) calculation.
smoothPeriods int int The value of the periods used for the volatility smoothing factor calculation.

Returns VariableIndexDynamicAverage

Examples

var vidya = Indicators.VariableIndexDynamicAverage(9, 12);
if (Bars.ClosePrices.LastValue > vidya.Result.LastValue)
    Print("Price is above VIDYA {0}", vidya.Result.LastValue);
vidya = api.Indicators.VariableIndexDynamicAverage(9, 12)
if api.Bars.ClosePrices.LastValue > vidya.Result.LastValue:
    api.Print(f"Price is above VIDYA {vidya.Result.LastValue}")