def ema(prices, days, correctie ,smoothing=2):
    """Calculate exponential moving average
    https://python.plainenglish.io/how-to-calculate-the-ema-of-a-stock-with-python-5d6fb3a29f5

    Args:
        prices ([type]): [description]
        days (int): [description]
        correctie (int): Needed because the first values will be NaN
        smoothing (int, optional):[description]. Defaults to 2.

    Returns:
        [type]: [description]
    """
    #
    #ema = [sum(prices[:days]) / days]
    ema = []

    for price in prices[:days-1+correctie]:
        ema.append(None)
    ema.append(sum(prices[correctie:+correctie+days]) / days)
    for price in prices[days+correctie:]:
        if price != None and ema[-1]!=None:
            ema.append((price * (smoothing / (1 + days))) + ema[-1] * (1 - (smoothing / (1 + days))))
        else:
            ema.append(None)

    return ema