从Python调用IB API
IB = Interactive Brokers
似乎有两个主要选择
- SWIG
- Boost.Python + Py++
我在某种程度上了解使用这两种方法的相对优缺点。但几乎所有讨论(SO)都讨论这些工具中哪一个更适合复杂的任务。我想问的是,我应该使用这两个中的哪一个来将一些数据传递给 C++ 例程,然后调用 API?
我想我只是问学习曲线!
IB = Interactive Brokers
There seem to be two main choices
- SWIG
- Boost.Python + Py++
I understand the relative merits or demerits of using these two methods to some extent. But almost all discussions (in SO) talk about which of these tools would be better for a complex task. What I want to ask is, which of these two should I use for just passing some data to a c++ routine which then calls the API?
I guess I am just asking about the learning curve!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IBpy 是一个很棒的解决方案,它是基于 java 版本的 API 构建的包装器。
http://code.google.com/p/ibpy/
IBpy is a great solution it's a wrapper built on the java version of the API.
http://code.google.com/p/ibpy/
我可以提出第三个选择吗?就学习曲线而言 pyCxx 非常出色。我认为它比 SWIG 或 Boost 更轻。您可能会感兴趣。您可以查看示例来启动第一个模块。
我过去曾成功地使用过它,并且发现它很容易使用。
我希望它有帮助
Can I propose a 3rd choice? In term of learning curve pyCxx is excellent. I think it is lighter than SWIG or Boost. It might be interesting for you. You can look at the examples to start a 1st module.
I've used it with success in the past and I found it easy to use.
I hope it helps
此版本的 ibpy 适用于最新版本的 IB API(至少截至 2014 年 7 月):https:// github.com/blampe/IbPy
我已经成功使用它几个月了。我所要做的就是将 ibpy 克隆到某个地方:
并从那里安装:
我最初是从 http://www.quantstart.com/articles/Using-Python-IBPy-and-the-Interactive-Brokers-API-to-Automate-Trades
安装完成后,Python 中的界面与 Java API 界面几乎相同:IB API pdf
我发现查看 IB API 中包含的 TWS 测试客户端 Java 代码很有用。
This version of ibpy works for me with the latest versions of the IB API (as of July 2014 anyway): https://github.com/blampe/IbPy
I've been using it successfully for months now. All I had to do was clone ibpy somewhere:
and install from there:
I got this originally from http://www.quantstart.com/articles/Using-Python-IBPy-and-the-Interactive-Brokers-API-to-Automate-Trades
Once you've got that installed, the interface in python is pretty much identical to the Java API interface: IB API pdf
I found it useful to look at the TWS Test Client Java code included with the IB API.