Vidya


Summary

Volatility Index Dynamic Average (VIDYA) is a smoothing (moving average) based on dynamically changing periods.

Syntax

public Vidya Vidya(DataSeries source, int periods, double r2Scale)

Parameters

NameDescription

Example 1

[Parameter]
public DataSeries Price { get; set; }
[Parameter("Period", DefaultValue = 14)]
public int Period { get; set; }
[Parameter("Sigma", DefaultValue = 0.65, MinValue = 0.1, MaxValue = 0.95)]
public double Sigma { get; set; }
private Vidya vidya;
protected override void OnStart()
{
    vidya = Indicators.Vidya(Price, Period, Sigma);
}
protected override void OnTick()
{
    //If vidya is greater than a specific value
    if (vidya.Result.LastValue > Value)
    {
        //Do something
        Print("LastValue {0}", vidya.Result.LastValue);
    }
    //...
}