vn.py官网
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 45
声望: 0

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Member
avatar
加入于:
帖子: 2748
声望: 189

请贴一下完整报错截图

Member
avatar
加入于:
帖子: 45
声望: 0

sa_cu: 触发异常已停止
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\engine.py", line 327, in call_strategy_func
func()
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\strategies\sa_trading_strategy.py", line 87, in on_init
self.load_bars(71)
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\template.py", line 237, in load_bars
self.strategy_engine.load_bars(self, days, interval)
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\engine.py", line 247, in load_bars
data = self.load_bar(vt_symbol, days, interval)
File "c:\vnstudio\lib\site-packages\vnpy\app\portfolio_strategy\engine.py", line 301, in load_bar
data = self.main_engine.query_history(req, contract.gateway_name)
File "c:\vnstudio\lib\site-packages\vnpy\trader\engine.py", line 249, in query_history
return gateway.query_history(req)
File "c:\vnstudio\lib\site-packages\vnpy\gateway\da\da_gateway.py", line 187, in query_history
reader = DictReader(StringIO(r.json()))
File "c:\vnstudio\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "c:\vnstudio\lib\site-packages\simplejson__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "c:\vnstudio\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "c:\vnstudio\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Member
avatar
加入于:
帖子: 2748
声望: 189

那就请在r = requests.get(path, headers=headers, params=params)这一行下print一下收到的r吧

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

沪公网安备 31011502017034号