public static double Value(TimeSeries input, int index, int length, BarData option) { if (index < length + input.FirstIndex) return double.NaN; double num1 = Math.Abs(input.GetMax(index - length + 1, index, option) - input.GetMin(index - length + 1, index, option)); double num2 = 0.0; for (int index1 = index; index1 > index - length; --index1) num2 += Math.Abs(input[index1, option] - input[index1 - 1, option]); return num1 / num2; }
public static double Value(TimeSeries input, int index, int length) { if (index < length - 1 + input.FirstIndex) return double.NaN; double num = input[index, BarData.Close]; double min = input.GetMin(index - length + 1, index, BarData.Low); double max = input.GetMax(index - length + 1, index, BarData.High); return -100.0 * (max - num) / (max - min); }
public static double Value(TimeSeries input, int index, int length) { if (index >= length + input.FirstIndex) return input.GetMax(index - length, index - 1, BarData.High); else return double.NaN; }
public static double Value(TimeSeries input, int index, int length, int order) { if (index < length + order - 1 + input.FirstIndex) return double.NaN; double num1 = 0.0; for (int index2 = index; index2 > index - order; --index2) { double min = input.GetMin(index2 - length + 1, index2, BarData.Low); double max = input.GetMax(index2 - length + 1, index2, BarData.High); double num2 = input[index2, BarData.Close]; double num3 = max - min; double num4 = num2 - min; num1 += 100.0 * num4 / num3; } return num1 / (double) order; }
public static double Value(TimeSeries input, int index, int length) { if (index < length - 1 + input.FirstIndex) return double.NaN; double min = input.GetMin(index - length + 1, index, BarData.Low); return Math.Log(input.GetMax(index - length + 1, index, BarData.High) / min); }