/// <summary> /// Initializes a new instance of the average class /// </summary> /// <param name="name">The name of the indicator instance</param> /// <param name="n">The window period (must be even). Example value: 16</param> /// <param name="longPeriod">The average period. Example value: 198</param> public FractalAdaptiveMovingAverage(string name, int n, int longPeriod) : base(name) { if (n % 2 > 0) { throw new ArgumentException("N must be even."); } _n = n; _w = CalculateW(longPeriod); _high = new RollingWindow <double>(n); _low = new RollingWindow <double>(n); }
/// <summary> /// Initializes a new instance of the WindowIndicator class /// </summary> /// <param name="name">The name of this indicator</param> /// <param name="period">The number of data points to hold in the window</param> protected WindowIndicator(string name, int period) : base(name) { _window = new RollingWindow <T>(period); }