Ingesting data into zipline

2.3k views Asked by At

I want to use Zipline, but Zipline does not financial data that I need. Now to make my my own data bundle I went through the following link: http://www.zipline.io/bundles.html

From what I understood I passed the following command on my ubuntu terminal:

"zipline ingest -b /home/furqan/Desktop/python_data"

My data is saved in folder 'python_data' located on desktop. Passing the above command I got into following error:

Error: No bundle registered with the name'/home/furqan/Desktop/python_data'`

How should I solve this issue?

2

There are 2 answers

3
James On

As said at iPython magic for Zipline cannot find data bundle, it is a known bug in zipline. It says to load zipline as shown below before you do anything else with it. import os

from zipline.utils.run_algo import load_extensions

load_extensions(
    default=True,
    extensions=[],
    strict=True,
    environ=os.environ,
)
0
Sherry Zhang On

To ingest custom data from csv files, you should follow the instructions here.

You can register your own bundle by editing your extension.py file, and then ingest data to this custom bundle. Also, you can use the csvdir bundle provided by zipline.

First make sure that your data is in correct OHLCV format as their tutorial shows. Then in your path for data /home/furqan/Desktop/python_data, create two folders, minute and daily, and place your data files in the folders seperately according to frequency (if you are only using minute or daily frequency data, just create one folder). One file per asset, and the file name should be the name of asset.

Finally, run the ingest command from terminal:

$ CSVDIR=/home/furqan/Desktop/python_data zipline ingest -b your-bundle-name

where the parameter for -b is your bundle name. For example, if you are using csvdir bundle, it should be -b csvdir.