问题标签 [ibpy]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
4688 浏览

python - 无法使用 python 连接到盈透证券

我想用python连接到IB,这是我的代码:

每当我使用此代码时,我都会收到此错误,表明我无法连接到服务器:

为什么我无法连接到 IB?

0 投票
3 回答
10219 浏览

interactive-brokers - Getting parameters of listed options & futures in Interactive Brokers API

There are a lot of examples showing how to get particular asset's price from Interactive Brokers. However, when I want to get the whole chain of options for one asset, I don't know which particular strikes are listed. Same for futures, I don't know which expirations are available at the moment. So, i.e., for options, I just loop through all possible strikes and reqMktData for each, also making a sleep(1) every 100 messages to avoid hitting the limit for number of requests per second. Obviously, many of these messages return with error "No security definition has been found for the request".

This looks like the wrong approach as it wastes lots of time on non-existing assets. Is there any more clean way to do this, or a special function for such purpose?

0 投票
1 回答
1414 浏览

python - 使用 ibpy 断开与盈透证券的连接

这是一段非常标准的代码,我用来通过 python 从 Interactive Brokers API 请求一些数据:

我希望连接在之后关闭con.disconnect(),但是它会不断获取新数据(消息打印更新的出价、询问等)。

为什么disconnect()似乎什么也没做,我如何才能真正关闭连接?

0 投票
2 回答
1383 浏览

python - 如何在 Mac OS 上安装 ibPy

我是 Python 的新手,但我的目标是使用 Python 和交互式经纪人构建交易算法。我已经在我的 Mac 上下载了 ibPy。我现在在我的“下载”目录中有一个文件夹,我不知道如何处理: - 我应该把它拖到某个地方吗?在哪里 ?- 如何在我的电脑上实际设置 ibPy。

请尽可能具体,因为我真的不明白它是如何工作的。我一直在使用 pip3 randonly (之前随机成功),但它在这里不起作用。

谢谢你的帮助。

0 投票
1 回答
1393 浏览

python - ibpy:“不能分配给无”

我新安装了 ibpy 并遇到以下问题:

为什么它找不到它?我该如何解决这个问题并下载一些价格数据?

谢谢你们。

0 投票
1 回答
278 浏览

python - 客户端在 IbPy 中提前终止

我正在尝试在我的 linux 服务器机器上运行 IBpy,我正在使用 IBgateway 将我的 api 代码连接到 IB。
我正在订购限价单,问题是 IBgateway 正在终止我的客户端连接。
一旦下订单,连接就会关闭,使我无法获得订单状态。
(当我在 Windows 机器上运行相同的代码时,它可以完美运行。)

我用来下订单的代码:

0 投票
2 回答
2101 浏览

python - 使用 python ibPy 库获取您的投资组合的位置

我正在使用 ibpy 来获取我的投资组合的位置。我明白我可以做到:

然后我应该以updatePortfolio()某种方式使用,但我不知道如何。

谢谢

0 投票
0 回答
127 浏览

python - Python 与 IPython 中的包注册?

我在 windows 和 WinPython 下使用“python setup.py install”手动安装了 IbPy。这些包似乎出现在正确的目录中;

跑步:

在 IPython 中工作正常,但在 Python 和 Eclipse 中我得到:

在 Eclipse 中,我可以看到 ib 并将其作为包的子目录。

有什么建议么?谢谢

0 投票
1 回答
1044 浏览

interactive-brokers - 下订单而不用 IBpy 传输?

我是新手IBpy,我想知道是否有任何方法可以在不发送订单并等待人工输入实际发送订单的情况下下订单?

我习惯placeOrder下订单,但我找不到不发送订单的方法。

任何帮助将不胜感激。

0 投票
1 回答
4113 浏览

python - ibpy:提取多个合约的 API 响应

我有兴趣将 ibpy 与 Interactive Brokers API 一起使用,以获取给定 100 只股票的实时报价数据。下面的代码来自网络上的示例,适用于一只股票。有人能告诉我如何同时处理 100 只股票吗?

Python脚本:

命令行输出: