按着删除C:\user|adminstot.vntrader/cta-staratege.data.json和CTA_STRATEGY_SETTING.JSON两个文件,重置,还是出现这种情况。
按着删除C:\user|adminstot.vntrader/cta-staratege.data.json和CTA_STRATEGY_SETTING.JSON两个文件,重置,还是出现这种情况。
raceback (most recent call last):
File "d:\vnstudio\lib\site-packages\vnpy\trader\ui\mainwindow.py", line 269, in closeEvent
self.main_engine.close()
File "d:\vnstudio\lib\site-packages\vnpy\trader\engine.py", line 229, in close
engine.close()
File "d:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 116, in close
self.stop_all_strategies()
File "d:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 855, in stop_all_strategies
self.stop_strategy(strategy_name)
File "d:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 716, in stop_strategy
self.sync_strategy_data(strategy)
File "d:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 812, in sync_strategy_data
save_json(self.data_filename, self.strategy_data)
File "d:\vnstudio\lib\site-packages\vnpy\trader\utility.py", line 116, in save_json
ensure_ascii=False
File "d:\vnstudio\lib\json__init.py", line 179, in dump
for chunk in iterable:
File "d:\vnstudio\lib\json\encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "d:\vnstudio\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "d:\vnstudio\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "d:\vnstudio\lib\json\encoder.py", line 438, in _iterencode
o = _default(o)
File "d:\vnstudio\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name_} '
TypeError: Object of type bool is not JSON serializable
应该是save_json的时候报的错,可能是你的strategy_data(variables)里面有json无法解析的字符吧