Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Neural Network algorithms in Zipline

Hi community,
I was wondering if someone build an algorithm using Neural Network in Zipline.

6 responses

Zipline is the open-source backtester/"market simulator" that powers Quantopian. However Quantopian's development platform doesn't support the commonly used neural network libraries (likely since they are very memory intensive and computationally expensive), so to implement a neural network in Zipline you'd have to use a different platform, set up your own server to execute algorithms, or run it all locally on your machine and then feed it to the Quantopian platform.

The easiest way to implement a neural network algorithm may be:
1. Set up a local Python environment with Zipline
2. Find access to high-quality data (if you're only using historical US equities price data, this shouldn't be too difficult*)
3. Train/test your neural network locally (where you can use libraries such as TensorFlow, Keras, etc)
4. Upload parameters/weights/whatever outputs to Quantopian via the Custom Data function
5. Use this data in your algorithm on Quantopian

*Note that this would involve some possibly tedious work cleaning the data, adjusting for splits/dividends, avoiding look-ahead bias, etc.

Hi @Adam,
Thank you for getting back to me.In fact, i built a basic linear model locally, seems like their is a bug, the returns stays always 0.0, but the same algorithm work normal on Q platform.

Not sure how I can help debug a local error. Did you supply your own data to Zipline locally? Just to emphasize, the below won't work locally.

from quantopian.pipeline.data.builtin import USEquityPricing  

No , I use the following instead: from zipline.pipeline.data import USEquityPricing . The same code run on Zipline but with a null returns.

Oh I didn't realize Zipline had equity pricing data already built-in.

Perhaps ask your question on Zipline's forum:
https://groups.google.com/forum/#!forum/zipline

Hi,
did you manage to build a NN model in Zipline environment?
Any hint on that?
Much appreciated
Isabel