0
我通過添加下面的$ ZIPLINE_ROOT目錄extenstion.py創建自定義的基本雅虎包:溜索捆綁昨天的數據
equities = {
'AAPL',
'QQQ',
}
register(
'test-bundle', # name this whatever you like
yahoo_equities(equities),
)
,當我運行包攝取一切都很好。
zipline ingest -b test-bundle
zipline bundles
產生輸出(我只是跑了一秒鐘前)
test-bundle 2016-12-10 20:13:11.014192
很大,一切都按預期工作。
當我運行溜索用2周的一些基本策略:
zipline run -f ./test_algo.py --start 2016-12-01 --end 2016-12-9 -o output.pickle --bundle test-bundle
運行,直到它到達週四(2016年12月8日)日期:
Traceback (most recent call last):
File "/usr/local/lib64/python3.5/site-packages/pandas/core/indexing.py", line 1325, in _has_valid_type error()
File "/usr/local/lib64/python3.5/site-packages/pandas/core/indexing.py", line 1320, in error (key, self.obj._get_axis_name(axis)))
KeyError: 'the label [2016-12-08 00:00:00+00:00] is not in the [index]'
During handling of the above exception, another exception occurred:
.... zipline stack trace
,但如果我運行:
zipline run -f ./test_algo.py --start 2016-12-01 --end 2016-12-7 -o output.pickle --bundle test-bundle
然後我得到預期的成功輸出:
[2016-12-10 20:17:11.519059] INFO: Performance: Simulated 5 trading days out of 5.
[2016-12-10 20:17:11.519495] INFO: Performance: first open: 2016-12-01 14:31:00+00:00
[2016-12-10 20:17:11.519770] INFO: Performance: last close: 2016-12-07 21:00:00+00:00
任何想法爲什麼我的軟件包正在下載到T-2數據。我預計會看到12/8和12/9的數據,市場是開放的,這是正常的日子,我在那些日子看到雅虎財經的數據。
謝謝 -