zipline bundles output:
(BackTesting) $ zipline bundles
csvdir
custom-data-bundle 2023-10-22 15:03:39.651317
quandl
quantopian-quandl
(BackTesting) $
zipline run:
(BackTesting) $ zipline run -f src/ma_strategy_crossover.py --capital-base 100000.0 -b custom-data-bundle -s 2021-1-1 -e 2023-9-29 --no-benchmark --trading-calendar XBOM --data-frequency daily
Traceback (most recent call last):
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/utils/memoize.py”, line 56, in get
return self._cache[instance]
File “/usr/lib/python3.10/weakref.py”, line 416, in getitem
return self.data[ref(key)]
KeyError: <weakref at 0x7f77bc9ba840; to ‘BcolzDailyBarReader’ at 0x7f77bc98e560>During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/mysys/StockMarkets/BackTesting/bin/zipline”, line 8, in
sys.exit(main())
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/main.py”, line 112, in _
return f(*args, **kwargs)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/main.py”, line 306, in run
return _run(
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/utils/run_algo.py”, line 163, in _run
data = DataPortal(
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/data/data_portal.py”, line 167, in init
last_sessions = [
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/data/data_portal.py”, line 168, in
reader.last_available_dt
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/data/bcolz_daily_bars.py”, line 493, in last_available_dt
return self.sessions[-1]
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/utils/memoize.py”, line 58, in get
self._cache[instance] = val = self.func(instance)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/zipline/data/bcolz_daily_bars.py”, line 452, in sessions
sessions = cal.sessions_in_range(start_session, end_session)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/exchange_calendars/exchange_calendar.py”, line 2199, in sessions_in_range
slc = self._get_sessions_slice(start, end, _parse)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/exchange_calendars/exchange_calendar.py”, line 2176, in _get_sessions_slice
start, end = self._parse_start_end_dates(start, end, _parse)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/exchange_calendars/exchange_calendar.py”, line 2172, in _parse_start_end_dates
return parse_date(start, “start”, self), parse_date(end, “end”, self)
File “/home/mysys/StockMarkets/BackTesting/lib/python3.10/site-packages/exchange_calendars/calendar_helpers.py”, line 393, in parse_date
raise errors.DateOutOfBounds(calendar, ts, param_name)
exchange_calendars.errors.DateOutOfBounds: Parameterstart
receieved as ‘2003-10-22 00:00:00’ although cannot be earlier than the first session of calendar ‘XBOM’ (‘2003-10-23 00:00:00’).
Even though, I pass start
parameter as value of -s 2021-1-1
, still it is converted to 2003-10-22 00:00:00
. How to resolve this issue?
If I remove that data bundle, ingest data again then it’s working fine. Any caching issue?