VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 5
声望: 1
Exception in thread Thread-15 (run):
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/ibapi/client.py", line 263, in run
    self.decoder.interpret(fields)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/ibapi/decoder.py", line 1296, in interpret
    handleInfo.processMeth(self, iter(fields))
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/ibapi/decoder.py", line 519, in processHistoricalDataMsg
    self.wrapper.historicalData(reqId, bar)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/py310/lib/python3.10/site-packages/vnpy_ib/ib_gateway.py", line 619, in historicalData
    symbol=self.history_req.symbol,
AttributeError: 'NoneType' object has no attribute 'symbol'
Member
avatar
加入于:
帖子: 5
声望: 1

最后发现还是req的问题:

self.client.reqHistoricalData(
            self.reqid,
            ib_contract,
            '',# end_str, workaround
            duration,
            bar_size,
            bar_type,
            0,
            1,
            False,
            []
        )

endDateTime, The request's end date and time (the empty string indicates current present moment).

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

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】