From 752b69e86e19db64cdf161981d0ad8c897efefea Mon Sep 17 00:00:00 2001 From: Oleg Ovcharenko Date: Sun, 15 Aug 2021 11:04:36 +0300 Subject: [PATCH] Fix for ALMA based on its original implementation Fixes #373 Original implementation by ALMA authors can be seen here: https://www.sierrachart.com/SupportBoard.php?PostID=231318#P231318 --- pandas_ta/overlap/alma.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas_ta/overlap/alma.py b/pandas_ta/overlap/alma.py index 2107831..3c12a62 100644 --- a/pandas_ta/overlap/alma.py +++ b/pandas_ta/overlap/alma.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from numpy import exp as npExp from numpy import nan as npNaN +from math import floor from pandas import Series from pandas_ta.utils import get_offset, verify_series @@ -17,7 +18,7 @@ def alma(close, length=None, sigma=None, distribution_offset=None, offset=None, if close is None: return # Pre-Calculations - m = distribution_offset * (length - 1) + m = floor(distribution_offset * (length - 1)) s = length / sigma wtd = list(range(length)) for i in range(0, length):