From f3a6eb0960321415fba34627e2740bdd7d3caebc Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Mon, 18 Jul 2016 17:02:14 -0700 Subject: [PATCH] fixing sigma calc on empty period. --- ema_series.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ema_series.go b/ema_series.go index fd5eda7..cd6ce13 100644 --- a/ema_series.go +++ b/ema_series.go @@ -45,7 +45,7 @@ func (ema EMASeries) Len() int { // GetSigma returns the smoothing factor for the serise. func (ema EMASeries) GetSigma() float64 { - return 2.0 / (float64(ema.Period) + 1) + return 2.0 / (float64(ema.GetPeriod()) + 1) } // GetValue gets a value at a given index.