Interactive Brokers C# Client

I have spent quite some time tirelessly porting the Interactive Brokers Java Socket Interface to C#. My initial port corresponds to the TWS API version 9.10, and shortly I will release a version which corresponds to the TWS API Beta 9.20.

Why did you do this?

I’m sure many of you are wondering why I would spend so much time on this, when Interactive Brokers now makes a .net version available through their J# compiler. The reasons are many, but mainly the J# component breaks a lot of C# design rules, and is poorly documented. My port places the documentation inline, so Visual Studio will bring up the messages, and so you are not working with cryptic const values.

Support / Stability

I plan to simultaneously support two C# clients, corresponding to the latest release of the TWS API as well as the TWS Beta API. My assembly versions will match the TWS API with an additional revision to correspond to my changes. For example, this initial release’s version is corresponding to TWS API 9.10 and my release version 1. Please note that this is release version 1. I am considering this an alpha release as I have mechanically ported and cleaned up a lot of the code, but have not thoroughly tested every function yet.


The source is free for you to use in any application you like. I ask, but do not require, you to give me credit and a link back if you like it. I also ask, but do not require that if you improve the library, or find any problems that you send me your changes / problem report, so I can continue to make this better. I want to be clear that I do not hold any liability or responsibility for any use / content of this code.


I have published MSDN style documentation from generated from the library at This documentation was populated from Interactive Broker’s User Guide, and notes from the IB Yahoo Forum and was generated using Microsoft Sandcastle with DocProject. I will continue to revise it on feedback from users, and as I find room for improvement.


I have created a forum, where I would like to collect problem reports / feature requests at and ask that any users register and provide feedback there. I will try to be very responsive, and incorporate your feedback.


This library is a port of the Interactive Brokers Java library, so of course I would like to credit the interactive broker’s developers for their API. I also used code from an article by Javier Compos "Description Enum TypeConverter" in order to transform the ugly consts to pretty enumerations with overridden ToString() functions.


Please note that I will maintain the latest on my utilities page.

26 Responses to “Interactive Brokers C# Client”

  • Sorry about that! I just corrected the article’s link, but it is located at



  • I sent you the source – did you get it?

  • Strange – I didn’t get it – try sending to email hidden; JavaScript is required, thanks!


  • nPLot code sent twice to email hidden; JavaScript is required – you have a spam block on your smtp server or client? No attachment sent – just a link.

    Well, this seems to work:

    So I’ll leave it up for a day or so and then take it down.

  • Wow,

    Too bad this wasn’t available a few months ago, before I finished my ATS rewrite based on the J# .NET component. Quick q for you – what are some specific disadvantages of the J# component? I know you mentioned it breaking some c# rules but anything else? Just wanted to consider if I should switch over…

  • GREAT JOB. Thanks a lot.
    I am trying to download docs but it seems
    “Download Compiled Help” link is broken.

    Could you fix that please?


  • hi, i want to use .NET brokers for connect to an access table, could it help me?, im learning .NET with C#


  • I have a problen when i run this program and it gives error “Socket unhandled “:he target machine actively refused” could any one can help me regarding this problem

  • Hello – that is just saying the client cannot access TWS. Do you have TWS running with the socket client support enabled?

  • yes i got the soloution..thank u sorry for late reply

  • Im going to use your sweet API for my algo trading class, if thats alright with you. Ill give you your due props. One thing, do you have a sample line of code that connects an instance of the Contract class to an Option? Something like this:

    m_Contract = gcnew Contract( 71178557, “IBMBB”, Krs::Ats::IBNet::SecurityType::Option, “2010/02”, 110.0, Krs::Ats::IBNet::RightType::Call, “100”, “SMART”, “USD”, “IBMBB”, “SMART”, Krs::Ats::IBNet::SecurityIdType::CUSIP, “” );

    But, this doesnt work, and Im not sure if I need to get the CUSIP or is there some other way?


  • Hi,
    The link to the documentation is broken (
    Can you give the right link?

  • Hi,

    Would it be possible to provide the correct link to the documentation.


  • Hi,
    I want to place a order and update order..What is the exect code.Any one help me..Its in c#.. thank you ..

  • the hosts which offer you unlimited bandwidth because that is surely
    an. Generally, the capacity of each is limited and because there are different site owners accessing the server,
    you have lower levels of security. After the process of web designing is complete you need
    to go live or launch your website.

  • After I originally commented I appear to have clicked the -Notify me when new
    comments are added- checkbox and now each time a comment is added I receive 4 emails
    with the same comment. Perhaps there is a way you are able to remove me from that service?

    Thank you!

  • Good day my mate! I want to state that this text is awesome, terrific authored and come with nearly all significant infos. I must notice more posts in this way .

  • Thanks a lot quite a lot to get sharing this particular wonderful individuals you truly know what you will be communicating close to! Book marked. Generously on top of that seek advice from this site Means). We’re able to possess a backlink return understanding in between all of us

  • It’s a shame you don’t have a donate button! I’d without a doubt donate to this outstanding blog!
    I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will share this website with my Facebook group.
    Talk soon!

  • You’re in point of fact a excellent webmaster. The web site loading pace is incredible. It sort of feels that you’re doing any unique trick. Furthermore, The contents are masterpiece. you have done a fantastic job in this topic!

  • Hi, always i used to check weblog posts here in the early hours in the dawn, because i like to find out
    more and more.

  • Right now it sounds like Movable Type is the preferred blogging
    platform out there right now. (from what I’ve read) Is that what you are using on your blog?

  • Create an Email List- An email marketing program will be successful when you send the emails to a targeted
    email list. Customer information is the lifeblood of any successful
    email marketing campaign, after all. The last thing you want to do is
    to confuse or frustrate people when contacting them to the point that they unsubscribe.

    Use a fixed-pitch font like Courier and perform a hard
    carriage return at the end of each line at 60 characters
    to avoid formatting problems. You will be very successful at email marketing if you know how
    to go about it correctly.

  • With increased than 15 themes to style for multiple gadgets and many times of changes, this task was enormous.
    ‘s guide

  • Novice or professional web designer only
    need to realize one purpose. t avford to piock up a designber bag, so thyey
    go for cheap replica handbags that are fairly same look wise as compared to
    designer bag but price wise they are much lower in cost.
    Each is equally beautiful and available at a much lower
    price on average. They propvide content direction solutions for websites and even a link buikding service for the site.
    After selecting your order, you need to kep track oof its progress.

Comments are currently closed.