Interactive Brokers automated trading

Go To


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.

>>>'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?

2012-04-04 03:22
by user1067327


The "DDE for Excel" API is by far the easiest of the API's to get up and running, and IB provides a sample program with instructions as to how to get it working. Also, the provided Java sample program is well documented as to how to get it working.

They don't provide a Python API.

2012-04-04 05:50
by rallison
"Python API" not needed, more universally merely REST (everything via https) would be fine for the trading program I've already written in Python, I don't have a need for speed. I'm sure IB code is good quality, just sadly disappointed they don't offer simple REST after having just downloaded what they provide.

Does anyone know whether Ameritrade or others like them provide API trading via the simplicity of https - gseattle 2013-12-23 08:32

  • is a possible alternative if you get 404 Page Not Found error for the link above
  • - Janos 2017-08-21 12:44


    While there's no officially supported Python API, I've been using ibpy successfully for months now, and it's quite easy. No need to concern oneself with java2python etc. All I had to do was clone ibpy somewhere:

    git clone

    install from there:

    cd IbPy
    python install

    And voila, it's done. I got this originally from

    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.

    Edit: IB has now had their own python API for a while, so not much more need for ibPy unless you're on python 2.

    2014-07-20 03:16
    by fantabolous
    i have a basic IbPy question .. are you still around - Zanam 2016-01-10 21:54


    Or you can use R with IBrokers package.Example:

    tws <- twsConnect()
    id <- reqIds(tws)
    placeOrder(tws, twsSTK("AAPL"), twsOrder(id))
    2015-11-17 22:13
    by kevinL