public static double SumOfSquares(IRingNavigator <BarItem> ringNavigator, int barCount) { double sumResult = 0; for (int index = 0; index < barCount; index++) { sumResult += ringNavigator.Last(index).Close *ringNavigator.Last(index).Close; } return(sumResult); }
public static double MinimumLow(IRingNavigator <BarItem> ringNavigator, int barCount, int startIndex = 0) { double min = ringNavigator.Last(startIndex).Low; for (int index = startIndex; index < (barCount + startIndex); index++) { if (min > ringNavigator.Last(index).Low) { min = ringNavigator.Last(index).Low; } } return(min); }
public static double MaximumHigh(IRingNavigator <BarItem> ringNavigator, int barCount, int startIndex = 0) { double max = ringNavigator.Last(startIndex).High; for (int index = startIndex; index < (barCount + startIndex); index++) { if (max < ringNavigator.Last(index).High) { max = ringNavigator.Last(index).High; } } return(max); }
public static double Sum(IRingNavigator <T> ringNavigator, int barCount) { double sumResult = 0; for (int index = 0; index < barCount; index++) { sumResult += ringNavigator.Last(index).Value; } return(sumResult); }
public static double Sum(IRingNavigator <MultiValueIndicator> ringNavigator, int valueIndex, int barCount) { double sumResult = 0; for (int index = 0; index < barCount; index++) { sumResult += ringNavigator.Last(index).Values[valueIndex]; } return(sumResult); }
public static double Sum(IRingNavigator <BarItem> ringNavigator, int barCount) { double sumResult = double.NaN; if (ringNavigator.HasValue(barCount - 1)) { sumResult = 0; for (int index = 0; index < barCount; index++) { sumResult += ringNavigator.Last(index).Close; } } return(sumResult); }
public static double NextSumOfSquares(IRingNavigator <BarItem> ringNavigator, double lastSumOfSquare, int barCount) { return((lastSumOfSquare + (ringNavigator.FirstToLast.Close * ringNavigator.FirstToLast.Close)) - (ringNavigator.Last(barCount + 1).Close *ringNavigator.Last(barCount + 1).Close)); }
public static double NextSum(IRingNavigator <BarItem> ringNavigator, double lastSum, int barCount) { return((lastSum + ringNavigator.FirstToLast.Close) - ringNavigator.Last(barCount + 1).Close); }
public static double NextSum(IRingNavigator <MultiValueIndicator> ringNavigator, int valueIndex, double lastSum, int barCount) { return((lastSum + ringNavigator.FirstToLast.Values[valueIndex]) - ringNavigator.Last(barCount + 1).Values[valueIndex]); }
public static double NextSum(IRingNavigator <SingleValueIndicator> ringNavigator, double lastSum, int barCount) { return((lastSum + ringNavigator.FirstToLast.Value) - ringNavigator.Last(barCount + 1).Value); }