C vs Java programming for IB

Discussion in 'Automated Trading' started by thesharpone, Nov 17, 2007.

  1. would anyone care to comment on the thread title?

    note: not C++ just C.

    I got a hold of the tws-c-api files, it's pretty cool, main files; twsapi.c and twsapi.h and it seems to directly connect to IB tws through win sockets, twsapi.c includes only two files;

    #include "twsapi.h"
    #include < winsock2.h>

    Really clean code!

    I haven't seen the java code yet, though I was testing the visualjsharp code, what a load of shit, it's niether visual nor code, fuck microsoft with their thinking process
  2. segv


    I do not understand why you would want to wrangle the TWS Java API from C/C++ unless you have legacy code.
  3. it's cause I prefer C over J
  4. the thing that makes me think Java over C is; I see IBTWS is built in Java
  5. segv


  6. Corey


    If communication is done via sockets, who cares what the platform was written in? To write your client in a language because thats what the server is written in is nonsensical. Packets are packets are packets, no matter what language.

    Pick whichever one you are more comfortable with -- what can you write faster, cleaner code in? Are you more comfortable with an OOP design or C's pass-by-reference paradigm? What makes sense in your head?

    Why not C++?

    Also, just so you know, 'J' and 'Java' are different languages -- so people might be a bit confused if you refer to Java as 'J'.
  7. I guess so. I tried the sample Java code provided by IB, it seemed ok, at least better than what I was expecting it to be. And I was able to easily run it with Web Start. But still haven't studied it in detail. I would still like to hear more opinions regarding choice of language.

    I was thinking why IB doesn't have direct connect instead of passing orders by submitting them to TWS then to IB?, but then I remembered this http://www.interactivebrokers.com/en/p.php?f=connAltern&p=i&ib_entity=llc , IB CTCI, it sounds pretty cool, it states that one can even submit hidden orders.

    C is close to perfect, it's also very close to assembly (& so machine code).

    If TWS was written in C by good programmers it would initialize and run much faster than it's current speed, but I can see why they did it in Java; they wouldn't have to debug and recompile it for each OS, laziness.

    Name an OS written in Java, Java runs on a virtual machine that runs on an OS, same with all of microsoft's fucking programming languages, at least you can respect Sun for sticking to one language. Let's see; Basic, C#, J#, C Omega, F#, X#, Sing#, Spec#, wow, what a fucking zoo of languages, is this africa or something?, Bill: "oh let's see where the next 40 billion $ is, try anything and everything that comes into your fucking indian minds", the bitch and his under-bitch won the lottery (with the support of the gov) once, how many times are they supposed to win it in a life time to fucking get their gay ass out of where it doesn't belong?! People have to fucking die in order to realize that they are not some immortal moran, God and good thing they do, but too bad it's late when they do rot to death, and take their shitty dreams with them to their fucking toilet graves.

    Anyhow one can argue that C is more for system and core development versus Java and Basic for building application.

    thanks for pointing it out, many on their path to a computer science PHD or masters program, thought of hiring an indian to develop a new programming language for them, and name it after their oak tree, you know being street smart and getting some gay attention from other higher university bitches.

  8. Everything counts. You spend 1 ms submitting your order via TCP/IP, and Java based TWS can easily spend 50-100ms processing your order before submitting it into IB OMS. FIX is the best (and the most complex though) approach.

    It really depends on the strategy, but when it comes to the fastest ATS, nothing can beat C++. For those who want to use C - it's not faster than C++, and you'll end up with the slower code once the project gets complex and you'll try to emulate OOD/OOP.
  9. I spent years developing in C on *nix machines for a living - mostly in data comms and telecoms which is really quite similiar to dealing with market data and ATS type work. While I have every respect for K&R and both C and Unix, wild horses wouldn't drag me back to C from Java for most things without some compelling reason.

    Simply put, it is easier to develop in Java (or maybe C#) than in C or C++. You will get the job done sooner.

    The performance issue is (mostly) a non starter. The modern JVM is quite fast enough for most things including TWS. And every millisecond doesn't count except in very specialized circumstances. If your round trip time to exchange is 150 msec, then 1 msec processing time extra is irrelevant.

    But as another poster (almost) said, if the protocol used to talk to TWS is documented, or you can infer it from reading the source code for the API libs provided by IB, you can write your app in any language you choose.
  10. rwk


    I agree. The best language is usually the one you know (except maybe FORTRAN or COBOL:p ). People have written systems for IB's API in a wide variety of languages including newer tools like Python and Matlab. I use Delphi. There is also a very active developer community for the API (but not the FIX implementation).
    #10     Nov 17, 2007