Update kama.py

keyError when using sc[i] or close[i]
This commit is contained in:
moritzgun
2021-03-15 17:28:15 +01:00
committed by GitHub
parent a31489af18
commit 519efafa7a
+1 -1
View File
@@ -32,7 +32,7 @@ def kama(close, length=None, fast=None, slow=None, drift=None, offset=None, **kw
result = [npNaN for _ in range(0, length - 1)] + [0]
for i in range(length, m):
result.append(sc[i] * close[i] + (1 - sc[i]) * result[i - 1])
result.append(sc.iloc[i] * close.iloc[i] + (1 - sc.iloc[i]) * result[i - 1])
kama = Series(result, index=close.index)