public static double Value(ISeries input, int index, int length1, int length2, BarData barData = BarData.Close) { if (index >= 0) { double num = EMA.Value(input, index, length1, barData); double num2 = EMA.Value(input, index, length2, barData); return(num - num2); } return(double.NaN); }
public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close) { if (index >= 1) { double num = 2.0 / (double)(length + 1); double num2 = EMA.Value(input, index - 1, length, barData); return(num2 + num * (input[index, barData] - num2)); } if (index == 0) { return(input[0, barData]); } return(double.NaN); }