@Channelchan
2018-01-06T07:24:25.000000Z
字数 998
阅读 125314
config分为base/extra/mod
mod分为sys_analyser/sys_progress/sys_risk/sys_simulation
config = {"base": {#设置回测开始时间"start_date": "2017-01-03",#设置回测结束时间"end_date": "2017-06-01",#设置回测的品种与初始资金额"accounts": {'stock':1000000, 'future':1000000},#设置基准收益"benchmark": "000300.XSHG",#运行当下策略文件"strategy_file_path": os.path.abspath(__file__)},"extra": {#查看最详细的日志,'error'只看错误。"log_level": "verbose",},"mod": {"sys_analyser": {#保存report至当下文件"report_save_path": '.',#启动策略逐行性能分析"enabled": True,#打印图形"plot": True},"sys_simulation": {"enabled": True,#设置手续费的倍数,默认是10"commission_multiplier": 20,#设置滑点"slippage": 0.001}}}# 您可以指定您要传递的参数rqalpha.run_func(init=init, handle_bar=handle_bar, config=config)
from rqalpha import run_codecode = """init(context):passhandle_bar(context, bar_dict):pass"""config = {"base": {"start_date": "2016-06-01","end_date": "2016-12-01","accounts": {'stock':1000000},"benchmark": "000300.XSHG"},"extra": {"log_level": "verbose",},"mod": {"sys_analyser": {"enabled": True,"plot": True}}}run_code(code, config)
