def compute_ema_from_list(ema0, y_values, alpha=0.1):
    """ema_t+n = (1-α)^n*ema + αΣ(1-α)^(n-i)*y_i"""
    assert isinstance(y_values, list), "y_values has to be a list"
    n = len(y_values)
    alphy = 1-alpha
    return (alphy)**n*ema0 + alpha*sum([y_val*alphy**(n-1-i) for i,y_val in enumerate(y_values)])