Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
 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));
 }
Exemple #8
0
 public static double NextSum(IRingNavigator <BarItem> ringNavigator, double lastSum, int barCount)
 {
     return((lastSum + ringNavigator.FirstToLast.Close) - ringNavigator.Last(barCount + 1).Close);
 }
Exemple #9
0
 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]);
 }
Exemple #10
0
 public static double NextSum(IRingNavigator <SingleValueIndicator> ringNavigator, double lastSum, int barCount)
 {
     return((lastSum + ringNavigator.FirstToLast.Value) - ringNavigator.Last(barCount + 1).Value);
 }