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
This commit is contained in:
Oleg Ovcharenko
2021-08-15 11:04:36 +03:00
committed by GitHub
parent bc3b292bf1
commit 752b69e86e
+2 -1
View File
@@ -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):