ricequant / rqalpha

A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
http://rqalpha.io
Other
5.39k stars 1.62k forks source link

如果要进行分钟线,请注意是否拥有对应的数据源? #227

Closed yssource closed 6 years ago

yssource commented 6 years ago

如果要进行分钟线,请注意是否拥有对应的数据源

raise NotImplementedError

既然, 通过第三方数据源是可以配置 frequency=1m 的, 为啥这里还 raise NotImplementedError, 导致事实上不能跑 1m

Traceback (most recent call last):
  File "/home/devel/rqalpha/rqalpha/model/bar.py", line 339, in __getitem__
    return self._cache[order_book_id]
KeyError: '399006.XSHE'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/devel/rqalpha/rqalpha/model/bar.py", line 342, in __getitem__
    bar = self._data_proxy.get_bar(order_book_id, self._dt, self._frequency)
  File "/home/devel/rqalpha/rqalpha/data/data_proxy.py", line 133, in get_bar
    bar = self._data_source.get_bar(instrument, dt, frequency)
  File "/home/devel/rqalpha-mod-tushare/rqalpha_mod_tushare/data_source.py", line 46, in get_bar
    return super(TushareKDataSource, self).get_bar(instrument, dt, frequency)
  File "/home/devel/rqalpha/rqalpha/data/base_data_source.py", line 123, in get_bar
    raise NotImplementedError
NotImplementedError
yssource commented 6 years ago

rqalpha 的逻辑是对的. 第三方 mod 应该 override, get_bar history_bars 这两个方法