mhallsmoore / qstrader

QuantStart.com - QSTrader backtesting simulation engine.
https://www.quantstart.com/qstrader/
MIT License
2.84k stars 851 forks source link

Python version #310

Closed joe-smalley closed 4 years ago

joe-smalley commented 4 years ago

What version of Python is it best run this project on?

I'm a newbie to Python, have installed 3.7 and am getting "AttributeError: 'DataFrame' object has no attribute 'ix'" error trying to run the example "buy_and_hold_backtest.py". I suspect it could be the Python version as that's the only thing I can think of that might be different. Thanks

joe-smalley commented 4 years ago

I now suspect it's a 3.7 version issue (or dependency thereof). If I deactivate the virtual environment, and install on my Mac's installed version of 2.7, the script runs ok. If it's not compatible with 3.7 can I suggest that the compatible versions are noted in the readme file?

When I now run the backtest I see:

`Running Backtest...

Backtest complete. Sharpe Ratio: 0.25 Max Drawdown: 79.59%`

But nothing else.

Where are the 'tearsheets' suppose to appear or be written to? Thanks

ch01ca commented 4 years ago

I have the same question

mhallsmoore commented 4 years ago

Hi @cero1010 and @joe-smalley,

The requirements.txt has now been updated to reflect modern Python package versions. Previously the code was being tested for Python 2.7, 3.4 and 3.5. The code is now tested for Python 3.5, 3.6 and 3.7, with the latest version of Pandas.

The .ix issue is a Pandas deprecation for accessing Series/DataFrame data. The correct method to use is now .iloc. This has been changed throughout the code.

Kind regards,

Mike.