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

Hi,

I'm interested in doing multiple backtests in a loop. That is, I've N different trading signals and I'd like to backtest each one separately, and record final returns. I'd like to automate the loop so I don't need to manually change the script and press "backtest" for each signal. Could this be done? how? Thank you!

-SR

6 responses

Hello Shai,

How big is N? And what do you mean by "different trading signals"?

As is, the online version of Quantopian doesn't support backtesting in batches or a loop (except by manually running multiple versions of an algorithm in separate browser tabs). I haven't used it myself, but there is an offline version of the backtester called zipline (as I understand, a modified version of zipline is the engine for the online backtester). Zipline is available on https://github.com/quantopian/zipline, with a separate discussion group ([email protected] and https://groups.google.com/forum/#!forum/zipline). Also, see http://zipline.io/.

With zipline, you won't have access to the Quantopian data, but I gather that folks have been successful with free daily bars downloaded from Yahoo, etc. (e.g. https://www.quantopian.com/posts/zipline-in-the-cloud-optimizing-financial-trading-algorithms).

Note also that Thomas Wiecki (Quantopian employee) has been talking about developing optimization routines that would run on the online version of Quantopian. So, if you are looking to optimize a set of parameters in your algorithm, you might ask for his advice.

Grant

Hello Grant,
N=500, external signlas are go long/ go short based on non financial data, e.g news stroies, weather, twitter, etc.
Yes zipline could be interesting, but we want db free of survivorship bias, to the best of my knowledge yahoo/google data don't fulfill this. We are ready to pay for adequate standalone db that can interface to zipline, is such available from quantopian or a 3'rd party?
Thank you,
Shai

Hello Shai,

A bunch of ideas on data sources here:

http://stackoverflow.com/questions/754593/source-of-historical-stock-data

Quantopian gets their data from a vendor, which they have not revealed. One poster stated that it might be Thompson Reuters (see post), which seems like a reasonable guess looking at the range of their product offerings (see http://thomsonreuters.com/products_services/financial/financial_products/).

Grant

http://www.kibot.com looks pretty good, at first glance. --Grant

Thanks Grant, kibot data look very interesting.

Grant, they get their data from Quandl and other data sources. It says it in their API,