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())); }
protected override decimal Calculate(int index) { // z-score = (ref - mean) / sd return((_indicator.GetValue(index).Minus(_mean.GetValue(index))).DividedBy(_sd.GetValue(index))); }