【问题标题】:Why IBKR API keeps showing ___ object has no attribute ___?为什么 IBKR API 一直显示 ___ 对象没有属性 ___?
【发布时间】:2021-09-08 12:19:56
【问题描述】:

enter image description here

enter image description here

以下额外信息:

  1. 我认为连接已经建立(我打开了 TWS 并为 API 做了正确的设置)
  2. 我用 anaconda 制作了正确的虚拟环境
  3. 我将所有相关的 TWS 文件移动到该文件夹​​中,并在那里设置带有虚拟环境的终端。

【问题讨论】:

    标签: api attributes trading interactive-brokers tws


    【解决方案1】:

    您的historicalData 方法访问一个名为data 的实例变量,该变量尚未创建。假设data 是一个字典,您可以通过在__init__ 中添加一行来创建它:

    def __init__(self):
        EClient.__init__(self, self)
        data = {}
    

    【讨论】:

      猜你喜欢
      • 2013-02-27
      • 2016-08-09
      • 2013-04-20
      • 2016-07-12
      • 1970-01-01
      • 2019-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多