Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to take back-testing code and convert it to forward-testing code?

How do you take back-tested code written using the zipline API and convert that into forward-testing code using the IB API (or better yet ib-insync API)? It seems like you would have to completely re-write your code from scratch (time-consuming) and introduce a ton of errors by doing so. Ideally, you would write your algo, backtest it, adjust it, and when you are satisfied with backtest performance, take the same code and forward test it. In other words, not use two separate scripts (one to back-test and one to forward-test), just use one.

2 responses

I have zero experience with any of these solutions, but here are the common answers to your question. For trading Quantopian-style algorithms on IB, you could try either IBridgePy or zipline-live. Alternately, QuantConnect is a hosted solution that will allow you to do both backtesting and live trading on IB within the same platform.

I am really surprised to know that Quantopian does not support even paper trading anymore today.
If you are considering alternative solutions to run your Quantopian strategies on your own machine or a server in cloud, please try www.IBridgePy.com
Migration instruction is here
http://www.ibridgepy.com/tutorials/#Migrating_from_Quantopian_to_IBridgePy
Also, IBridgePy starts to support backtest using IB's historical data and data from other data providers.
You may learn IBridgePy's backtest features on YouTube
https://www.youtube.com/watch?v=xWMzTgGWv48&t=624s

DISCLAIMER: This is Dr. Hui Liu, the creator of IBridgePy