6

I've tried to setup Interactive Broker's C++ API in Visual Studio 2008, but I know very limited C++ and I keep getiing errors. :<

1) Is there any way to use some kind of light scripting language to connect to Interactive Brokers and make trade. F.E.

login.('username','password')
>>>'Connected'
makeTrade('GOOG','550')
>>>'Trade Completed'

Something light like Python would be just fine, and yes I have looked into IBPY, but I do not understand how the java2python system works.

2) How did you setup your automated system, or how would you set up your automated trading system with Interactive Brokers?

4

4 回答 4

3

“DDE for Excel”API 是迄今为止最容易启动和运行的 API,IB 提供了一个示例程序,其中包含有关如何使其工作的说明。 https://interactivebrokers.github.io/tws-api/excel_apis.html


现在有许多选项可用于使用TWS API

于 2012-04-04T05:50:07.053 回答
2

虽然没有官方支持的 Python API,但我已经成功使用 ibpy 几个月了,而且非常简单。无需关心 java2python 等。我所要做的就是在某处克隆 ibpy:

git clone https://github.com/blampe/IbPy

从那里安装:

cd IbPy
python setup.py install

瞧,它完成了。我最初是从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 代码很有用。

编辑: IB 现在拥有自己的 python API 已经有一段时间了,所以除非你在 python 2 上,否则不再需要 ibPy。

于 2014-07-20T03:16:29.877 回答
1

或者您可以将 R 与 IBrokers 包一起使用。示例:

tws <- twsConnect()
id <- reqIds(tws)
placeOrder(tws, twsSTK("AAPL"), twsOrder(id))
cancelOrder(id)
于 2015-11-17T22:13:44.277 回答
0

使用TWS API进行算法交易有很多选择。

选择以下任何一项,包括Excel

  1. C#
  2. C++
  3. VB
  4. Java
  5. Python
  6. Excel
于 2021-06-05T16:24:23.643 回答