stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
13.39k stars 4.23k forks source link

Unable to replicate backtest performance | Chapter 8 02_backtesting_with_zipline #312

Closed benhsampson closed 1 month ago

benhsampson commented 10 months ago

Running the notebook myself, the backtest performs worse. Note that I've imported the notebook and not made any modifications.

My run image

From repo image

Environment Python 3.8 Here's the important dependencies in requirements.txt file after running pip freeze > requirements.txt

TA-Lib==0.4.28
zipline-reloaded==2.1.1
pyfolio-reloaded==0.9.4
BlockchainPunks commented 9 months ago

if possible - would you mind exporting your .yml files for your ml4t and backtester environments then attach them here.

you can do that using conda command.

The install instructions are messed - i'm looking for working windows exact package list which steps below will give here are steps: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#sharing-an-environment

this will help allot of the windows people - so would really appreciate your help

stefan-jansen commented 1 month ago

Can be differences in data (which may change depending on when you download), differences in the trained model, etc.

I"m sorry but the goal is to show you how you can run this, not to claim specific performance so I can't help much further, thanks for your understanding.