INNER CODE UNIT · Python
super_smoother
aticio/legitindicators · legitindicators.py:182
def super_smoother(data, length):
"""Python implementation of the Super Smoother indicator created by John Ehlers
:param data: list of price data
:type data: list
:param length: period
:type length: int
:return: Super smoothed price data
:rtype: list
"""
ssf = []
for i, _ in enumerate(data):
if i < 2:
ssf.append(0)
else:
arg = 1.414 * 3.14159 / length
a_1 = math.exp(-arg)
b_1 = 2 * a_1 * math.cos(4.44/float(length))