public static double Value(ISeries input, int index, int length, double k, BarData barData = BarData.Close) { if (index >= length - 1) { return(SMA.Value(input, index, length, barData) + k * SMD.Value(input, index, length, barData)); } return(double.NaN); }
public static double Value(ISeries input, int index, int length, double shift, BarData barData = BarData.Close) { if (index >= length - 1) { double num = SMA.Value(input, index, length, barData); return(num + num * (shift / 100.0)); } return(double.NaN); }
public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close) { if (index >= length - 1) { double num = SMA.Value(input, index, length, barData); return((input[index, barData] - num) / num * 100.0); } return(double.NaN); }
public static double Value(ISeries input, int index, int length1, int length2, BarData barData = BarData.Close) { if (index >= length1 - 1 && index >= length2 - 1) { double num = SMA.Value(input, index, length1, barData); double num2 = SMA.Value(input, index, length2, barData); return(num - num2); } return(double.NaN); }
public static double Value(ISeries input, int index, int length) { if (index >= length) { double num = 0.0; for (int i = index - length + 1; i <= index; i++) { num += TR.Value(input, i); } num /= (double)length; return(SMA.Value(input, index, length, BarData.Typical) - num); } return(double.NaN); }
public static double Value(ISeries input, int index, int length, BarData barData = BarData.Close) { if (index >= length - 1) { double num = 0.0; double num2 = SMA.Value(input, index, length, barData); for (int i = index; i > index - length; i--) { num += (num2 - input[i, barData]) * (num2 - input[i, barData]); } return(num / (double)length); } return(double.NaN); }
public static double Value(ISeries input, int index, int length1, int length2) { if (index >= length1 - 1 && index >= length2 - 1) { TimeSeries timeSeries = new TimeSeries(); for (int i = index - Math.Max(length1, length2) + 1; i <= index; i++) { timeSeries.Add(input.GetDateTime(i), input[i, BarData.Volume]); } double num = SMA.Value(timeSeries, length1 - 1, length1, BarData.Close); double num2 = SMA.Value(timeSeries, length2 - 1, length2, BarData.Close); return(num - num2); } return(double.NaN); }