6
$\begingroup$

I intend to set up a fully automated system for trading equities and futures. As preparation for this project, I worked through a couple of books on the topic, e.g., "Trading Evolved" by Andreas F. Clenow. In said book, Andreas uses the Python library Zipline for backtesting trading strategies whereas data for both equities and futures is sourced from Quandl. While working through the book, I made a couple of observations which might influence my choice of the backtesting engine as well as the source of financial data and I am hoping to obtain some hints here.

First of all, I found out that the algorithmic trading library Zipline is not maintained anymore (though it worked perfectly for me to run all the sample code regarding equities). Therefore, I would like to know if there exist alternatives to Zipline, which are advisable and have the same (or even superior) functionality as compared to Zipline?

Moreover, when working through the sample code of said book, I was not able to run trading strategies regarding futures. The reason is that I could not source historic futures data from Quandl (which, however, worked perfectly fine for historic equities data). Therefore, I am wondering if someone has hints how to source historic futures data from Quandl (since it should work according to the book) and/or which alternative data sources for historic futures data exist and are recommendable.

Thanks a lot in advance.

$\endgroup$
1
  • $\begingroup$ A very warm welcome, to Quant.SE - please see my answer below! $\endgroup$
    – vonjd
    Commented Apr 5, 2021 at 19:59

5 Answers 5

2
$\begingroup$

QuantRocket supports backtesting and live trading with Zipline:

https://www.quantrocket.com/zipline/

QuantRocket maintains its own fork of Zipline and thus is unaffected by the shutdown of Quantopian, Zipline's original maintainer. End-of-day and 1-minute historical equities data are included, and you can backtest and trade futures strategies by connecting to an Interactive Brokers account for futures data.

Disclaimer: I'm affiliated with QuantRocket.

$\endgroup$
6
  • 1
    $\begingroup$ Thanks a lot, Brian. I have watched parts of the introductory video. What would be the added benefit of using quantrocket over just implementing trading strategies using the Python packages zipline, pandas, numpy and pyfolio in combination with sourcing data from quandl? $\endgroup$
    – Tobson
    Commented Apr 6, 2021 at 22:45
  • $\begingroup$ At first, I thought Quantrocket is a blessing but I ran into problems. Unfortunately, support is part of the paid package. $\endgroup$ Commented Aug 20, 2022 at 16:23
  • $\begingroup$ @AnatolyAlekseev I toned down your comment quite a bit. If you have issues QuantRocket, contact them directly. $\endgroup$
    – Bob Jansen
    Commented Aug 20, 2022 at 20:34
  • $\begingroup$ Bob, sorry for overreacting, they are not possible to be contacted. No email, not possible to raise a github issue, no any way to report a technical problem. One only can create a ticket if it's a payment question. Looks like scam to me. Now that you have removed the technical error message provided by me it's even less chances it will be addressed, and people will lose time just to figure out there are unresolved tech bugs and misinformation about number of freely available tickers. I have never seen a legit provider that avoids fixing tech bugs even if report comes from a free user. $\endgroup$ Commented Aug 21, 2022 at 13:39
  • $\begingroup$ @Tobson, Zipline is a complicated library for DIY. Quantopian developed it to run inside their web-based platform; the libraries like Zipline and pyfolio that they open sourced were only part of that larger puzzle, so out of the box those libraries never “just worked” on their own. Integrating data is particularly challenging. $\endgroup$ Commented Aug 22, 2022 at 13:31
2
$\begingroup$

Concerning the backtesting engine I would recommend R, especially with the packages quantmod and PerformanceAnalytics.

I wrote a blog post which gets you started by providing a simple step-by-step template:

  1. Load libraries and data
  2. Create your indicator
  3. Use indicator to create equity curve
  4. Evaluate strategy performance

You can find the post here: Backtest Trading Strategies Like a Real Quant

$\endgroup$
1
  • 2
    $\begingroup$ Thanks for your answer. Your blog looks very interesting. I am not familiar with the R packages quantmod and PerformanceAnalytics. After having a quick look, I am of the impression that the combination of Python packages numpy, pandas, pyfolio, zipline should provide the same functionality (I could be wrong). Notwithstanding it's always good to have alternative options available. In case I will run into problems regarding certain topics, e.g., future rolling, I might consider switching to R. All the best $\endgroup$
    – Tobson
    Commented Apr 6, 2021 at 22:21
1
$\begingroup$

There are two Zipline forks worth checking:

I have no affiliation with neither of the two, but personally I like zipline-reloaded the most, because it runs on Python 3.9 while zipline-trader only recently added support for Python 3.6. However zipline-trader supports live trading with Alpaca or IB, so you should take a look at these brokers to see what they offer in terms of the future trading and how much does it cost.

$\endgroup$
1
  • $\begingroup$ I think it's worth mentioning that both forks have very little code activity after 2016- so I'm not sure if I see the value of using any of those over the original version from quantopian $\endgroup$
    – Glenn Bech
    Commented May 23 at 8:00
0
$\begingroup$

For backtesters, id recommend quantconnect or backtrader

https://www.quantconnect.com/ https://www.backtrader.com/

For data sources...

https://iexcloud.io/ https://polygon.io/

All the best, Brett

$\endgroup$
2
  • $\begingroup$ Thanks a lot, Brett. I will further investigate these options. $\endgroup$
    – Tobson
    Commented Apr 6, 2021 at 22:27
  • 1
    $\begingroup$ QuantConnect is quite similar to Zipline as it is an event-driven backtester. The reason why I personally dislike is because it is very slow, most like due to the engine being written in C#, so when I run my strategies coded in Python all calls have to be translated into C# under the hood. $\endgroup$
    – mac13k
    Commented Jan 30, 2023 at 14:18
0
$\begingroup$

Andreas Clenow himself suggests Zipline-Reloaded Documentation can be found here. It is maintained by Stefan Jansen (thank you Stefan), the author of Machine Learning for Algorithmic Trading

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.