Open hemzyt opened 4 years ago
I am the same person. I have figured out the issue. Apparently, the listdir() is wrong. It is supposed to be /home/user/<path to csv files>
. Another error may present itself in the bundle python file. On line 75, the formati
must be changed to format
. It is an apparent typo from the Trading Evolved book. This will be helpful for those using the book.
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Now that you know a little about me, let me tell you about the issue I am having:
Description of Issue
$ zipline ingest -b customdata
zipline ingest -b customdata
Error: No bundle registered with the name 'customdata'
Here is how you can reproduce this issue on your machine:
Reproduction Steps
$ pip install yfinance
$ cat > importdata.py
download dataframe and covert to proper .csv for zipline(date,open,high,low,close,volume,dividend,split)
stockList = ['SPY', 'TLT', 'IEF', 'GLD', 'DBC'] for stock in stockList: data = pdr.get_data_yahoo(stock, period='max', auto_adjust=True) # get data = data.reset_index() # get date data = data.rename(columns={'Date': 'date', 'Open': 'open', 'High': 'high', 'Low': 'low', 'Close': 'close', 'Volume': 'volume'}) #rearrange and rename data.to_csv('{}.csv'.format(stock), index = False)
$ ls ~/downloads/customdata DBC.csv GLD.csv IEF.csv SPY.csv TLT.csv import_data.py
$ nano extension.py
register('customdata.py', customdata . customdata , calendar_name='NYSE')
$ zipline ingest -b custom-csvdir-bundle
Output:...
-Raul