216 浏览
0

获取品种SHFE.ag2112 K线,api中使用了web_gui=True,然后就加载一个指标从昨天就出现BUG了,目前还找不到原因,看报错好像是api.wait_update()出现问题了,KeyError: ”

Traceback (most recent call last):
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py”, line 193, in _run_module_as_main
“__main__”, mod_spec)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2021.6.944021595\pythonFiles\lib\python\debugpy\__main__.py”, line 45, in <module>
cli.main()
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2021.6.944021595\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py”, line 444, in main
run()
File “c:\Users\Administrator\.vscode\extensions\ms-python.python-2021.6.944021595\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py”, line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str(“__main__”))
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py”, line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py”, line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “h:\owenquan\owen\quantification\TqSdk\test\test.py”, line 79, in <module>
api.wait_update()
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tqsdk\api.py”, line 1729, in wait_update
self._process_serial_extra_array(serial)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tqsdk\api.py”, line 3040, in _process_serial_extra_array
int(serial[“array”][-1, 1]) + 1, data)
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tqsdk\api.py”, line 3079, in _process_chart_data_for_web
“value”: data[“”][i]
KeyError: ”

发表新评论

不好意思,找到原因了,编写绘图时加了线的宽度和颜色,其中一个命名写错了,与其它不一致造成