飞索全地形在2016年10月30日将一个星期日定为特殊交易日

时间:2018-10-23 15:31:47

标签: quantitative-finance trading algorithmic-trading zipline quantopian

HI Zipline开发人员,

我正在研究Zipline中的非美国股票数据。

我创建了自定义日历。我有adhoc_holidays,但我想将一个星期日(2016年10月30日)作为一个交易日。

<string>:22: UserWarning: Overwriting bundle with name 'csvdir'
Traceback (most recent call last):
  File "/Users/praj3/anaconda3/envs/ZipPallavi/bin/zipline", line 11, in <module>
    load_entry_point('zipline==1.3.0', 'console_scripts', 'zipline')()
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/zipline/__main__.py", line 348, in ingest
    show_progress,
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/zipline/data/bundles/core.py", line 364, in ingest
    calendar = get_calendar(bundle.calendar_name)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/trading_calendars/calendar_utils.py", line 92, in get_calendar
    calendar = self._calendars[canonical_name] = factory()
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/trading_calendars/trading_calendar.py", line 89, in __init__
    _overwrite_special_dates(_all_days, self._opens, _special_opens)
  File "/Users/praj3/anaconda3/envs/ZipPallavi/lib/python3.5/site-packages/trading_calendars/trading_calendar.py", line 931, in _overwrite_special_dates
    raise ValueError("Special dates %s are not trading days." % bad_dates)
**ValueError: Special dates [Timestamp('2016-10-30 03:45:00+0000', tz='UTC')] are not trading days.**
(/Users/praj3/anaconda3/envs/ZipPallavi) bash-3.2$ 



@property
    def special_opens(self):
        return [
            (time(9, 15), HolidayCalendar([SpecialOpen]))
        ]
SpecialOpen = Holiday(
 'Special Sunday',
    month=10,
    day=30,
    year=2016
)

0 个答案:

没有答案