Now that Quantopian is no more, what is the best way to use Zipline, Alphalens, and PyFolio? Seems like a shame to not be able to use these tools locally. Any recommendations on how to use them on your own machine? (don’t want to put my data and models in the cloud via QuantConnect). Maybe just use Backtrader and some other tools? Thanks.
Hey @sbenn, thanks for your question and welcome to the community!
I"m just in the middle of releasing an updated Zipline version that runs on Python 3.7-3.9. It already works on Ubuntu and there should be wheels (Mac OSX) and/or conda packages (esp Windows) shortly.
You can already run Zipline locally using the Docker image that accompanies the book but direct install will of course be easier. I’ve also stripped out a few Zipline dependencies that should make it easier to further develop the package and import different datasets more easily.
Hope this helps, in a week or two there should be more info on this.
Thanks Stefan. Does this mean we’ll be able to use Alphalens and Pyfolio as well? Thanks again for the prompt reply.
Excellent work!! Open-source community thrives because of people like you! A Big Thank you!
Any reason we can’t use zipline-trader to follow along with the materials in your book? Zipline Trader — Zipline Trader 1.6.0 documentation Seems like we can use Alphalens and Pyfolio as well. Thanks again for your help!
You’ve made beautiful webpage and I would definitely buy your book!
Just to let you know, there is around 500 community members around Zipline Trader on slack channel. Maybe you could join and introduce your book and your webpage. Slack channel link is on the bottom of github page below: GitHub - shlomikushchi/zipline-trader: Zipline Trader, a Pythonic Algorithmic Trading Library with broker integration.
I think you could benefit from community around zipline trader and community could benefit from your great work!
Thanks for the advice on getting to the Zipline-Trader slack channel. Unfortunately the link to the Slack channel has expired. Can you please post an updated link so we can all check it out? I agree that Stefan’s book would be a very welcome addition to the knowledge base of that group as it’s the most practical book I have found on implementing these methodologies.
Here is zipline community slack channel. Sign up here, from any device: https://join.slack.com/t/zipline-live/shared_invite/zt-oo5fidqa-CkcLPnpA3jjIgSt~5xaJAw
There are not many practical books and I’m sure not many in the community know about his book.
Yes, I’ve also patched pyfolio to work with the latest pandas. You can install from GitHub for now, I’ll put up conda/pip packages in due course: GitHub - stefan-jansen/pyfolio: Portfolio and risk analytics in Python
Thanks for the update Stefan.
I just tried to install zipline-reloaded on a new conda environment with Python 3.8 (Windows 64) and received the following error:
UnsatisfiableError: The following specifications were found to be incompatible with each other: Output in format: Requested package -> Available versions
Anybody else have success installing it on a Windows machine? thanks for your help.
I just tested again in a fresh conda environment on Windows 64 with Python 3.8 and it both install and imports fine. Do you perhaps need to run
conda update conda -n base?
Thanks Stefan. I couldn’t install it using conda, but was able to install it using pip after I installed talib. I then installed Alphalens and Pyfolio from git through your fork. I’m trying to work through Chapters 4 through 8 of your book. Now that I have these packages installed, is there anything you foresee that could cause a problem in working through these five chapters / notebooks? I can understand how frustrating it must be to have things change so much after you released your book, but we all owe you thanks for helping those of us who want to learn from your book.
Thank you. Glad to hear it was possible to install it via pip although I’m of course a bit concerned that it works in one environment but not another. There shouldn’t be any issues with those chapters in principle; since I won’t be able to update the environments you’d just have to install the requisite packages. Shouldn’t be more than just running ‘pip install’ for anything listed in the imports for a given notebook. The promise is to no longer need a separate env for backtesting with Zipline. On the other hand, given the large number of packages throughout the book, it might still be a good idea to have multiple environments should there be dependency conflicts.
Feel free to ping me here or raise a GitHub issue if you run into any problems and I’ll take a look.
Thanks Stefan. I will post my progress in the appropriate section of the Community site: Factors and Features. I’m trying to make my way through the notebooks and will post on where I get stuck. Hopefully it will be useful to others who try to work their way through the book and notebooks. Thanks again for your help in learning from your book.
I encountered a similar situation running Ubuntu 18.04. The conda install raised a similar issue, but the pip install worked fine after installing dependencies.
I love your work. Double thumbs up!
I also realize that the Conda package that targets Python 3.9 only includes 2.0.0.rc4 of Zipline reloaded.
Can I request for you to release zipline 2.0.0.post1 into Conda?
That’s right, I’m sorry but I believe there were some issues building the Py39 conda versions. Will revisit in the coming days.
Hi Stefan, thanks for providing a quick reply. I just thought you have done it in pypi and it would be a shame not to release it in anaconda.
No hurry though.
On another note, since pyfolio is such a good trading analytics package and it currently works with Python up to version 3.8, can I ask whether there is any plan to make Pyfolio work with Python 3.9?
That’s indeed the plan.
Thanks a lot, Stefan!