vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 1
声望: 0

Traceback (most recent call last):
File "c:\vnstudio2\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 281, in open_widget
widget = widget_class(self.main_engine, self.event_engine)
File "c:\vnstudio2\lib\site-packages\vnpy\app\cta_strategy\ui\widget.py", line 37, in init
self.cta_engine.init_engine()
File "c:\vnstudio2\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 110, in init_engine
self.load_strategy_data()
File "c:\vnstudio2\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 801, in load_strategy_data
self.strategy_data = load_json(self.data_filename)
File "c:\vnstudio2\lib\site-packages\vnpy\trader\utility.py", line 99, in load_json
data = json.load(f)
File "c:\vnstudio2\lib\json__init.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "c:\vnstudio2\lib\json\
init__.py", line 348, in loads
return _default_decoder.decode(s)
File "c:\vnstudio2\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\vnstudio2\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 20 column 20 (char 408)

Member
avatar
加入于:
帖子: 2643
声望: 157

首先请删除C:\users\administrator.vntrader文件夹里对应的json文件:

cta_strategy_setting.json
cta_strategy_data.json
注意,这里的administrator应该是你的Windows操作系统用户名。删除后重启VN Trader即可。

如果后续再次出现该错误,请检查策略代码中,是否有把str、bool、int、float类型以外的变量名称写到了parameters列表中,这四种类型以外的变量由于无法通过json序列化会导致保存策略状态出错(损坏json文件)。

https://www.vnpy.com/forum/topic/5322-vn-pyxin-shou-ru-men-faq-2020-12-11

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号