Zipline => No bundle registered... Error

Hi there,

I'm receiving an "Unknown Bundle" error when trying to execute run_algorithm in zipline.

I created the bundle using:

from quantrocket.zipline import create_bundle_from_db
create_bundle_from_db("faang-1d-bundle", from_db="usstock-1d", universes="faang", calendar="XNAS", start_date="2015-01-01")

I can list the bundle using:

from quantrocket.zipline import list_bundles
list_bundles()

The results from list_bundles() are:

{'aapl-1d-bundle': True,
 'cl-rb-1d': True,
 'faang-1d-bundle': True,
 'usstock-1d': False,
 'usstock-1min': True}

The bundle I'm trying to access in run_algorithm is "faang-1d-bundle".

I also tried loading the bundle using:

from zipline.data.bundles import load
load('faang-1d-bundle')

And I received the the same error as when I try to use the bundle in run_algorithm.

The error message is:

UnknownBundle: No bundle registered with the name 'faang-1d-bundle'

Is there anything I need to do to register the bundle with zipline when it was created with quantrocket.zipline?

Please advise.

David

Instead of using run_algorithm, you need to use from quantrocket.zipline import backtest to run a backtest, so QuantRocket can hook everything up.

https://www.quantrocket.com/docs/#zipline-backtesting

Thanks! I was able to execute the backtest through quantrocket.zipline import backtest.

I have some custom plots defined in the strategy file.

How do I get them to display?

David

You can load the backtest CSV into Pandas in your notebook as explained in the docs, then create your custom plots in the notebook.

If you need additional data from the backtest in order to make the custom plots, you can include it in the CSV by using Zipline's record() function inside the backtest.