From 5cd20c3dcabc0101835ebea660f1d8756ae23050 Mon Sep 17 00:00:00 2001 From: Onur Cinar Date: Sun, 9 Jun 2024 17:02:14 -0700 Subject: [PATCH] Kaufman's Adaptive Moving Average (KAMA) indicator is added. --- trend/kama.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/trend/kama.go b/trend/kama.go index 9d858ef..9df6e69 100644 --- a/trend/kama.go +++ b/trend/kama.go @@ -115,10 +115,7 @@ func (k *Kama[T]) Compute(closings <-chan T) <-chan T { break } - sc, ok := <-scs - if !ok { - break - } + sc := <-scs prevKama = prevKama + sc*(closing-prevKama) kama <- prevKama