ranaroussi / qtpylib

QTPyLib, Pythonic Algorithmic Trading
http://qtpylib.io
Apache License 2.0
2.16k stars 513 forks source link

[BUG] module 'pandas' has no attribute 'ewma' #181

Open xerxes-k opened 1 year ago

xerxes-k commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

pd.ewma causing an error

To Reproduce Steps to reproduce the behavior:

indicators.py line 298

def rolling_weighted_mean(series, window=200, min_periods=None): min_periods = window if min_periods is None else min_periods try: return series.ewm(span=window, min_periods=min_periods).mean() except Exception as e: # noqa: F841 return pd.ewma(series, span=window, min_periods=min_periods)