Closed hy89 closed 3 years ago
https://rqalpha.readthedocs.io/zh_CN/latest/intro/optimizing_parameters.html#id3 该文档中代码用来测试时,抛出以上异常
代码如下:
import os import json import concurrent.futures import multiprocessing tasks = [] for short_period in range(3, 10, 2): for long_period in range(30, 90, 5): extra_vars = { "SHORTPERIOD": short_period, "LONGPERIOD": long_period, } vars_params = json.dumps(extra_vars).encode("utf-8").decode("utf-8") cmd = ("rqalpha run -fq 1d -f F:/Desktop/my_quant/rqalpha应用/均线策略/sma.py --start-date 2015-01-01 --end-date 2016-01-01 " "-o results/out-{short_period}-{long_period}.pkl --account stock 100000 --progress -bm 000001.XSHE --extra-vars '{params}' ").format( short_period=short_period, long_period=long_period, params=vars_params) tasks.append(cmd) def run_bt(cmd): print(cmd) os.system(cmd) if __name__ == '__main__': with concurrent.futures.ProcessPoolExecutor(max_workers=multiprocessing.cpu_count()) as executor: for task in tasks: executor.submit(run_bt, task)
请把启动命令展示完整一些
https://rqalpha.readthedocs.io/zh_CN/latest/intro/optimizing_parameters.html#id3 该文档中代码用来测试时,抛出以上异常
代码如下: