0

I have a trading algorithm that I am backtestesting on zipline. I have successfully ingested US common stocks bundle from a csv file.Moving forward I'd like to backtest it continuously in the end of each trading day.

So I'd like to append to my existing bundle the daily OHLCV prices for each US equities by downloading them from Interactive Brokers (I have written a python script that does that).

Now my question: How to append the new day's data row for each equity to my existing zipline bundle?

Specifically, I don't want to create new bundles.

Bai hui
  • 21
  • 3

1 Answers1

0

I happen to be investigating this myself, and my conclusion is that it is not possible. If any zipline developer is on air, please correct me if I am wrong.

Each ingestion will create a new SQLite table basically, those are easy to find under ~/.zipline/data.

Say you have three different CSVs for three different exchanges, you would have to import them separately in three different ingests.

What is disappointing (apparently, perhaps we are missing the supposed usage) is that when running a backtest one is constrained to one single ingestion universe. If my symbols list is scattered - i.e. products on different exchanges - then it is not possible to backtest such algo.

If you are relying on the default quandle space then you do not face this issue, provided your registration has enough visibility (the free API key is pretty restricted).

One solution could be to import all of the CSVs together, under a common trading calendar. This sounds artificial, but the impact on evaluating a non-day strategy should be negligible.

So if for example you have three sets of CSVs for AS, DE and MI just import them as a generic yahoo against one of the three calendars. The detailed procedure is explained here.

Thanks,

reim
  • 492
  • 5
  • 8