public static double Value(TimeSeries input, int index, int length, int order1, int order2) { if (index < length + order1 + order2 - 1 + input.FirstIndex) { return(double.NaN); } double num = 0.0; for (int index1 = index; index1 > index - order2; --index1) { num += K_Slow.Value(input, index1, length, order1); } return(num / (double)order2); }
protected override void Calculate(int index) { double Data = K_Slow.Value(this.fInput, index, this.fLength, this.fOrder); this.Add(this.fInput.GetDateTime(index), Data); }