Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Automated backtesting

If I had 1000 strategies to backtest, how would I do this programmatically on Quantopian? Each one uses the same general idea but modifies certain parameters for each iteration. How can I test all of these and find the optimal parameters for my idea?

7 responses

You wont be able to do that with Quantopian easily. You need to install zipline platform in your server and create a program that changes the values for your algorithm and run to save the data. I recommend you to save the results in a CSV so you can compare them out. By the way it takes long time to download the data from yahoo for each test so for 1000 backtesings is going to take several days to get all of the results or better you can pre-download the data from yahoo.

I forgot to mention the url

https://github.com/quantopian/zipline

A couple of years ago I did system optimizations with zipline in picloud. That service seems to have been discontinued....

How zipline is different from quantopain ? excep the latter is on cloud and probably simpler to use, are there more capabilties or code differences ?

@Mukund, this isn't currently available in the Quantopian backtester, you will have to manually kick off a full backtest for each iteration. Note that your data is saved in a full backtest. You can start it, close your laptop, walk away, and come back when the full backtest is finished to view the returns, logs, and performance. Parameter optimization will be easier in the upcoming research environment. This features hosted IPython notebooks where you can analyze datasets and run these calculations. Here's a demo sneak peak.

@Joe Zipline is Quantopian's backtesting engine. The code is entirely open sourced and available on Github. You're welcome to develop algorithms locally on your machine and then port them to Quantopian for further backtesting and to start live trading with the broker. If you're feeling ambitious, you can submit a pull request!

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

In Zipline, is it possible to paper trade in real-time? I would like my algorithms to run in real-time if possible.

No, Zipline is used to develop locally on your machine, it's not connected to a broker. If you'd like to paper trade, you can port your code over to Quantopian and trade using our free 15-minute delayed price feed or connect your Interactive Brokers account. You can connect both your paper and real money accounts.