Back to Community
Installing Zipline - Lord help me!

UPDATE: Zipline has been installed, but when I copy and paste the algo from GitHub into Anaconda (Spyder) it won't run. I found out it's missing a few lines of code to run:

lgo_obj = TradingAlgorithm(initialize=initialize, handle_data=handle_data)
perf_manual = algo_obj.run(data)

This brings on a new problem, 'data' not defined error.

Has anybody successfully managed to use zipline inside of Spyder? Please help.


SOLVED - Magically it finished installing, guess I needed a little more patience. Took about 15min to get past that line but on to bigger and better things here :)

Alright, so I've got Anaconda2 with python 2.7 32-bit installed. In Spyder console I've used the "conda install -c Quantopian zipline" command line. It goes through downloading a bunch of packages, then extracts the packages. It's got part way through "Unlinking packages ..." and has frozen at this line :

Unlinking packages ...
[ COMPLETE ]| | 0% [conda ]| | 0% [conda ]| | 0% [matplotlib ]|##### | 10% [numexpr ]|########## | 20% [numpy ]|############### | 30% [pandas ]|####################

This is the second time I've tried this now, well 3rd but that was with Anaconda 3 and Python 3.5 which I heard was even more of a pain. The previous time I believe it froze at a different line but none the less, I'm still kinda stuck.

I'm fairly new to python so if somebody has a hand to lend it'd be much appreciated. If you'd suggest I go a totally different route to install I'm all ears. As well, if a different IDE would work better, I'm open to everything.

The reason for all of this is because, from what I understand, Quantopian won't let me import a trained model, and when I try to run my training on Quantopian it says it's out of memory and to optimize my code. So figured I'd get out of Quantopian altogther and do it locally. Thanks!

8 responses

Lord help you I indeed. What are you trying to do? I found Zipline about 1,000 times too complex for my needs. And what data are you going to use? EOD? Or minute or tick or what?

When I try to train my machine learning model on Quantopian it runs out of memory. Since, as far as I know, there is no way to import a saved model into Quantopian, I'm forced to do the whole algo, and backtesting, locally. I did manage to get zipline installed but even the example in the tutorial on GitHub won't run, been trying for 4 hours now. I may not be very experienced with Python but I've been writing computer programs for 20 years, doing my best to not give up haha.

I'm happy with any data to get started. I'll be using minute data for the algo, and I can retrieve that myself if I need, I'd just like to try and make use of zipline so I don't have to build a backtesting engine from scratch. I think the tutorials on GitHub are a little outdated.

How are you going to train on minute data? You have it I guess? I eventually went a very different route and only use EOD data since my trades tend to be relatively longer term and of liquid instruments. Also I like to use futures in backtesting as well. If you want to trade short term I guess you need Q unless you want to spend a fortune on data. But what will you train the offline model with?

My main problem began with loading it onto a Windows hosted version of Anaconda - I spent literally weeks trying to fix the issues around the Compiler.

I'm a lot slicker with Python these days so could probably manage it.

If you feel you can make do on EOD data there are a number of Python based backtesters out there which beat the hell out of Q for simplicity. It's a quagmire.

Haven't trained any ML models on my setup yet but given all the software is Python depencies anyway this is not going to be a problem.

Google "python backtesting framework". There are one or two excellent frameworks out there.

I've got loads of good minute data to both backtest on and train with, it's the zipline issues that are killing me here. If you're saying there are better frameworks out there I'll take your word for it and drop Zipline / Quantopian altogether, I'm pretty much fed up with it. Thanks

I found Zipline impossible when I tried it. On the other hand I'm not sure whether any of these other frameworks handle minute data. You will have to take a look.

As I say....Maybe given I have worked very hard on Python for a year or so maybe I would not find it such a struggle now. On the other hand for me at least life's too short to want to venture into the badlands again.

If I don't see an updated installation and use tutorial from the Dev's sometime soon here I might be done with algo altogther. It's frustrating. I have a simple idea I want to test and none of the Quantopian software seems to be co-operating. Seeing as it is ML it could be trained on dairly data and still hold some weight in minute land, but I can't upload a trained model to Quantopian I don't think, not 100% sure yet though as nobody has replied to that question.

This forum does not support or give any help on Zipline itself. There is a Google group you can try but also if you think there is an error report it on the github page. You will get no response here on Zipline.