Open lamres opened 3 years ago
There are many similar issue reports. Each could have different reasons. Do you have your custom CSV files which does not have data on 2021-01-01?
In my case, I have CSV files whose starting date is different with each. I have cleaned up dates data before a certain point of time(for ex 2021-1-2), and make all the CSV files data starting from the same date.
My data file has candlesticks starting from summer 2017. This data contains a format like 2021-01-01 00:00:00, but error with example like 2021-01-01 00:00:00+0000, maybe trouble is here.
Hi @lamres, I am having the same issue. Did you find any solution for that?
@fazrad Hi. Unfortunately, I didn't.
@lamres
If you don't pass the trading_calendar
when calling run_algorithm()
, the Zipline uses the default calendar which is 'XNYS'.
You can solve it this way:
from trading_calendars import get_calendar
run_algorithm(..., trading_calendar=get_calendar('Binance'))
Hi there, I have almost the same problem. The ingested data is from 2020, but still I get the error
KeyError: Timestamp('2003-08-23 00:00:00+0000', tz='UTC')
This is exactly 20 years earlier than the day the data was ingested. Do you know how to solve this?
`--------------------------------------------------------------------------- KeyError Traceback (most recent call last) File pandas_libs\index.pyx:444, in pandas._libs.index.DatetimeEngine.get_loc()
File pandas_libs\hashtable_class_helper.pxi:1625, in pandas._libs.hashtable.Int64HashTable.get_item()
File pandas_libs\hashtable_class_helper.pxi:1632, in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 1061596800000000000
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last) File c:\Users\henry\miniconda3\envs\ml4t\lib\site-packages\pandas\core\indexes\base.py:3081, in Index.get_loc(self, key, method, tolerance) 3080 try: -> 3081 return self._engine.get_loc(casted_key) 3082 except KeyError as err:
File pandas_libs\index.pyx:413, in pandas._libs.index.DatetimeEngine.get_loc()
File pandas_libs\index.pyx:446, in pandas._libs.index.DatetimeEngine.get_loc()
KeyError: Timestamp('2003-08-23 00:00:00+0000', tz='UTC')
The above exception was the direct cause of the following exception: ... 686 return Index.get_loc(self, key, method, tolerance) 687 except KeyError as err: --> 688 raise KeyError(orig_key) from err
KeyError: Timestamp('2003-08-23 00:00:00+0000', tz='UTC')`
Hi everyone! I ingested a bundle by csv like this
After that I'm trying to run the Algo by this code
But I'm getting this error:
I use zipline version 1.4.1. What could be a reason of this?