Example #1
0
        protected override decimal Calculate(int index)
        {
            int     startIndex           = Math.Max(0, index - _timeFrame + 1);
            decimal numberOfObservations = index - startIndex + 1;

            return(_sdev.GetValue(index).DividedBy(numberOfObservations.Sqrt()));
        }
Example #2
0
 protected override decimal Calculate(int index)
 {
     // z-score = (ref - mean) / sd
     return((_indicator.GetValue(index).Minus(_mean.GetValue(index))).DividedBy(_sd.GetValue(index)));
 }