has anyone used the tws c api?

Discussion in 'Automated Trading' started by Tim Eisenberg, Jan 20, 2006.

  1. Hey
    I posted a question on a usenet forum the other day about the availability of a unix c++ api and somebody emailed me this link https://sourceforge.net/projects/tws-c-api and suggested I ask on elitetrader.
    So far so good, better than nothing. On the other hand this code is not supported by IB and seems to be maintained by some russian guy in his spare time. So I wonder if I can trust my ATS to an api like that and whether anyone has used it.
    I'm not sure I can trust it, so what other recommendations can you make?
    Please no java and no windows!!!
    Why is it that some people can't get it that some of us programmers demand c++, unix and matlab?!
    The other thing I don't like about the IB api is that they require a tws application to sit in the middle of all communications which means you can't connect to their servers directly. Hopefully it doesn't add too much to the latency. Anyone know what the latency is? I really need a fast link to the broker's servers.
  2. Why not maintain it yourself ? The API code is quite simple, as is the 'protocol' to/from the TWS. You can easily work out what it's doing from the Java API code. As new releases come out, a diff on the Java API source should quickly reveal changes. I don't think there is much of an issue here.

    In general TWS releases have been fairly good wrt backward API compatability.

    As for TWS latency, I reckon it's probably insignificant compared to internet / broker / exchange latencies. Simple common sense measures like not having a page full of high volume quote lines displayed, running minimised etc should be adopted. You can run it on a separate dedicated machine if you want to.

    TWS runs very reliably on Linux.
  3. dcraig, thanks for the feedback.
    I tried running that guy's api and example as edemo / demouser but it didn't work. Either his api is broken or the edemo account is not working very well at this late hour. I'll check out your suggestion to look at the java api for clues how to communicate with tws.
    Meanwhile if someone can send me a pointer to a real unix c/c++ api I'll buy you a beer and a lunch if you happen to drive in the CT/NY area.
  4. mg_mg


  5. TWS adding latency? Insignificant but TWS added and keeps adding a lot of trouble. IB got themselves in a real bind with their Java. One day, I'm sure, a competitor will see the light.

    As to " some of us programmers demand c++, unix and matlab?!". These are almost on the right track. The smart ones drop C++ and matlab. C++ is extremely useful only in rare cases where you ever need it; matlab is a worse pain in the neck than TWS. It is no 'programming language' at all. Use Python, the Ferrari of programming. It has even MLab for some of the matlab ops. Ever tried to do something like looping in matlab? :D This is most basic in any minimum programming task - in Matlab it's always a kludge. Simply try to rewrite a piece of MatLab serious matrix code into Python - you'll quickly find out and will never want to touch ML again. Further take a look at things like SciPy, Numeric, Rpy, Gnuplot, matplotlab/pylab for starters. You'll be equipped like the smartest research facilities in the world (all for free). :D

    BTW, for those liking matlab & C++, TWS doesn't really hold you back from using these.

    If you want a beautiful example of how to do an elegant TWS API interface, look at IbPy. You may even want to use it!