qlib
qlib copied to clipboard
examples\nested_decision_execution\workflow.py not work
🐛 Bug Description
To Reproduce
Steps to reproduce the behavior:
index 4943 is out of bounds for axis 0 with size 4943
File "C:\Git\qlib\qlib\backtest\utils.py", line 131, in get_step_time
return self._calendar[calendar_index], epsilon_change(self._calendar[calendar_index + 1])
File "C:\Git\qlib\qlib\contrib\strategy\signal_strategy.py", line 141, in generate_trade_decision
trade_start_time, trade_end_time = self.trade_calendar.get_step_time(trade_step)
File "C:\Git\qlib\qlib\backtest\backtest.py", line 89, in collect_data_loop
_trade_decision: BaseTradeDecision = trade_strategy.generate_trade_decision(_execute_result)
File "C:\Git\qlib\qlib\backtest\backtest.py", line 44, in backtest_loop
for _decision in collect_data_loop(start_time, end_time, trade_strategy, trade_executor, return_value):
File "C:\Git\qlib\qlib\backtest\__init__.py", line 275, in backtest
return backtest_loop(start_time, end_time, trade_strategy, trade_executor)
File "C:\Git\qlib\qlib\workflow\record_temp.py", line 473, in _generate
portfolio_metric_dict, indicator_dict = normal_backtest(
File "C:\Git\qlib\qlib\workflow\record_temp.py", line 234, in generate
return self._generate(*args, **kwargs)
File "C:\Git\qlib\examples\nested_decision_execution\workflow.py", line 269, in backtest
par.generate()
File "C:\Develop\Python3.8\Lib\site-packages\fire-0.5.0-py3.8.egg\fire\core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "C:\Develop\Python3.8\Lib\site-packages\fire-0.5.0-py3.8.egg\fire\core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "C:\Develop\Python3.8\Lib\site-packages\fire-0.5.0-py3.8.egg\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "C:\Git\qlib\examples\nested_decision_execution\workflow.py", line 394, in <module>
fire.Fire(NestedDecisionExecutionWorkflow)
File "C:\Develop\Python3.8\Lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Develop\Python3.8\Lib\runpy.py", line 194, in _run_module_as_main (Current frame)
return _run_code(code, main_globals, None,
IndexError: index 4943 is out of bounds for axis 0 with size 4943
Screenshot
Environment
Note: User could run cd scripts && python collect_info.py all
under project directory to get system information
and paste them here directly.
- Qlib version: lastest
- Python version: 3.8.10
- OS (
Windows
,Linux
,MacOS
): windows 11 22H2 - Commit number (optional, please provide it if you are using the dev version):