Jupyter运行多进程参数优化时报错:
"""
Traceback (most recent call last):
File "c:\vnstudio\lib\multiprocessing\pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 1164, in optimize
engine.run_backtesting()
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 293, in run_backtesting
func(data)
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 707, in new_bar
self.cross_stop_order()
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 874, in cross_stop_order
self.active_stop_orders.pop(stop_order.stop_orderid)
KeyError: 'STOP.42450'
"""
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
<ipython-input-1-744c12103984> in <module>
30 import time
31 start = time.time()
---> 32 res = engine.run_optimization(setting)
33 print (u'耗时:%s' %(time.time()-start))
c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py in run_optimization(self, optimization_setting, output)
553
554 # Sort results and output
--> 555 result_values = [result.get() for result in results]
556 result_values.sort(reverse=True, key=lambda result: result[1])
557
c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py in <listcomp>(.0)
553
554 # Sort results and output
--> 555 result_values = [result.get() for result in results]
556 result_values.sort(reverse=True, key=lambda result: result[1])
557
c:\vnstudio\lib\multiprocessing\pool.py in get(self, timeout)
681 return self._value
682 else:
--> 683 raise self._value
684
685 def _set(self, i, obj):
KeyError: 'STOP.42450'