@一路向上 请问下,我将g.security = '000300.XSHG' 换成 g.security = '600519.XSHG' 回测时就会报错。
报错信息如下:
2010-01-01 00:00:00 - INFO - 初始函数开始运行且全局只运行一次
2010-01-01 00:00:00 - ERROR - Traceback (most recent call last):
File "jqboson/core/entry.py", line 373, in _run
engine.start()
File "jqboson/core/engine.py", line 229, in start
self._load()
File "jqboson/core/engine.py", line 219, in _load
self._strategy.setup(self._context)
File "jqboson/core/strategy.py", line 446, in setup
self._initialize()
File "jqboson/core/strategy.py", line 471, in _initialize
self.do_strategy_initialize(self._context)
File "jqboson/core/strategy.py", line 385, in do_strategy_initialize
func(strategy_context)
File "/tmp/strategy/user_code.py", line 61, in initialize
g.ans.append(results.params[1])
File "pandas/core/series.py", line 521, in __getitem__
result = self.index.get_value(self, key)
File "pandas/core/index.py", line 1601, in get_value
return tslib.get_value_box(s, key)
File "pandas/tslib.pyx", line 673, in pandas.tslib.get_value_box (pandas/tslib.c:14153)
File "pandas/tslib.pyx", line 689, in pandas.tslib.get_value_box (pandas/tslib.c:13920)
IndexError: index out of bounds
@一路向上,RSRS指标 + 价格优化交易策略每天交易时间运行就报错,报错如下:
2018-09-13 09:30:00 - ERROR - Traceback (most recent call last):
File "jqboson/core/entry.py", line 374, in _run
engine.start()
File "jqboson/core/engine.py", line 240, in start
self._dispatcher.start()
File "jqboson/core/dispatcher.py", line 209, in start
self._loop()
File "jqboson/core/dispatcher.py", line 189, in _loop
self._event_bus.emit(ev[1])
File "jqboson/core/bus.py", line 35, in emit
ret.append(call(event))
File "jqboson/core/strategy.py", line 285, in _wrapper
return cb(self._context.strategy_environment.strategy_context)
File "/tmp/strategy/user_code.py", line 131, in market_open
if g.RSRS_stdratio_rightdev_list[context.previous_date] > g.buy and MA20_bef1 > MA20_bef3:
AttributeError: 'StrategyGlobals' object has no attribute 'RSRS_stdratio_rightdev_list'