C# or J# for IB API?

Discussion in 'Automated Trading' started by glok_twen, Jan 12, 2007.

  1. glok_twen


    Has anyone gotten a C# app to call the IB API? What about C# with Visual Express?

    Finally, how about J# express?
  2. If J# is what I think it is (a sort of Java on .NET) why would you want to do this instead of using real Java ?
  3. Yes, RightEdge and QuantDeveloper are two commercial C# products that interact with IB API. Though, I don't think there is a native C# API, instead some kind of ActiveX interop arrangement is used. Don't quote me on that.

    There's shouldn't be any reason not to be able to do this with Visual C# Express. SharpDevelop is another free IDE you might want to look at as an alternative to Express:

  4. One benefit would be the CLR. Not sure that is OP's reason though.
  5. Well, good luck to him, that's all I can say. I might be doing Microsoft an injustice, but you could end up with all sorts of problems like err .... bugs, lagging versions, semantic differences to the real thing etc. I'd imagine that J# exists for one reason only - to rope in the punters with a bunch of Java code into the .NET environment.

    I guess what I am saying is that with J# you have a language that pretends to be Java, but isn't really and there would very likely be differences between them that could cause real problems. Very much a marketing tool - not a core technology like C#.
  6. Agree. There would be no compelling reason for me personally to ever use J#.
  7. hazerider


    You have two choices. The first is to google for something called, I believe, IBNet. It's an old port to C# of the Java API. It isn't supported anymore though. If you search the IB forums, you'll find areference to it.
    Another thing you can do, which you will also find hinted at in the IB forums, is take the Java code, and build it in Visual Studio as a .NET assembly, which you can then call from your C# application. There is also a Java conversion tool you can use to transform the Java code into C# code, which has the advantage of making native CLR calls, but that requires manual changes too, as the conversion tool doesn't do everything for you.
    I am currently using the unsupported port, and it works just fine. I suspect it will keep working just fine for a while. Going forward, I am planning on getting the converted code to work. They do not change the API interface all too often, and it shouldn't be too hard to maintain.
    In short, it's nothing you can't do, assuming you are a somewhat competent programmer with enough time to fiddle.
    Out of curiosity, I am curious if there would be sufficient demand to spend time and make a supported C# API commercially available.
  8. GTG


  9. glok_twen


    thanks all.

    i might of left this out of the post but the reason was because i have the express version of vc++, which does not compile the ib api given it needs mfc.

    having read these responses and based on other research i've concluded the most straight forward ideas would be to either go buy the vc++ standard version for about $250 to get mfc, or to use java.

    j# is probably a bad option too as it will have development discontinued although supportted for 10 more years. but who knows how well it actually uses the underlying ib java libraries.

    i'm leaning now toward putting up the cash for vc++ simply because i know c++ but not java (even tho they are pretty close in syntax and java is so common these days.). but i am so tied to the user friendliness of the msft development tools i've gotten used to them.

    thanks all for your feedback.

    also GTC do you think that c# version will work with the express version of vc#?