1

我正在使用 IB 网关连接到 tws,使用来自https://gist.github.com/valiant-falstaff/4093998b625d76ef4afe的 IbPy 示例 Python 2.7 代码会产生以下错误:

Server Error: <error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  
Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS 
"Configure->API" menu.>
Server Response: error, <error id=-1, errorCode=502, errorMsg=Couldn't 
connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled 
on the TWS "Configure->API" menu.>
Server Error: <error id=-1, errorCode=504, errorMsg=Not connected>
Server Response: error, <error id=-1, errorCode=504, errorMsg=Not connected>

但是,我没有在我找到的所有示例中显示的网关 GUI 中选择“启用 ActiveX 和套接字客户端”的选项。这就是“标准”设置窗口的样子。这就是我的设置窗口的样子我的设置窗口。有人知道我该如何解决这个问题吗?

4

1 回答 1

0

Brian 发现了问题 - 代码调用了与 GUI 屏幕截图不同的端口。(为了结束而回答)

于 2017-04-25T04:26:21.503 回答