backtrader2 / backtrader

Python Backtesting library for trading strategies
https://www.backtrader.com
GNU General Public License v3.0
221 stars 52 forks source link

Fix issue 33 pd ols #60

Closed FGU1 closed 3 years ago

FGU1 commented 3 years ago

Modification of ols.py indicator, class OLS_BetaN to switch from pandas ols, which no longer exist in last versions of pandas, to statsmodels ols. Addition of a file for test of modified OLS_BetaN class. modification of travis.yml to add installation of statsmodels

FGU1 commented 3 years ago

ols.py indicator and associated test are running fine in travis with python3 interpreter, but raise an error with pypy. With pypy3 :

File "/home/travis/virtualenv/pypy3.6-7.3.1/site-packages/statsmodels/tsa/forecasting/stl.py", line 185, in STLForecast @Substitution(fit_params=indent(_fit_params, " " * 8)) File "/opt/python/pypy3.6-7.3.1/lib-python/3/textwrap.py", line 482, in indent return ''.join(prefixed_lines()) File "/opt/python/pypy3.6-7.3.1/lib-python/3/textwrap.py", line 480, in prefixed_lines for line in text.splitlines(True): AttributeError: 'NoneType' object has no attribute 'splitlines'

Closing this PR fow now.