Contract programming using TWS API's

Discussion in 'App Development' started by zdave83, Mar 9, 2019.

  1. zdave83

    zdave83

    Hello,

    If this post is in the wrong forum I apologize, and would appreciate feedback on which forum is appropriate.

    As the title describes, I'm searching for someone with extensive experience with TWS API's, IB's "sample" code, and can write .net code using them. I believe that starting with the TWS API "sample" code/environment as a starting point will save time versus writing everything from scratch. The custom written routine(s) would provide a bridge between an existing system I've written over many years, and the TWS API's needed to :
    1) retrieve quotes for options, option spreads and underlying symbols
    2) create untransmitted orders visible & actionable in the TWS application
    3) retrieve all current day orders - transmitted & untransmitted
    4) retrieve all current day order executions

    I believe the code for all of those functions already exists in the IB "sample" code. I'm looking for a custom routine that will branch into that existing code with required information, have the API execute, then branch back to the custom routine with the results. Obviously that's overly simplistic ... but that's the general idea. Besides saving time, the other benefit of starting with the "sample" code is the ability to perform testing if the API's don't appear to be working as expected ... meaning the API's can be tested/traced within the "sample" as delivered from IB as a comparison to how they function when triggered from the custom routine.

    It would be important to design this custom routine(s) such that it can be easily integrated into fresh updated versions of the TWS API "sample", understanding that a small amount of custom code and/or "hooks" may need to be added to the "sample" code in order to work with the custom routine(s).

    If that sounds like a strange approach to getting quotes and creating orders ... here's why. I started writing trade modeling systems in the 1990's using VB6 ... back when that was a real thing :) . As time went on I continued to use VB6 in the form of VBA, which was a nearly effortless transition for my code set. I looked at VB.net, C# and others ... but never found any tangible benefits for the time needed to migrate. The system continues to use a proprietary datastore, and has always integrated well with the charting capabilities in Excel. At this point I believe there's only a negative return on the time needed to immerse myself in the idiosyncrasies of either the TWS API's or VB.net. I just need a bridge to-and-from that functionality.

    Suggestions regarding this approach, and potentially better approaches, are greatly welcome !

    Thanks - Dave
     
  2. ZBZB

    ZBZB

    Try www.upwork.com there are quite a few people with experience of ib API.
     
    zdave83 likes this.
  3. qlai

    qlai

    And where does your current system connect for all these?

    The only useful (I hope) piece of advice I can offer is forget about the sample code. Open paper trading account and use it to test.
     
  4. zdave83

    zdave83

    Thanks !
     
  5. zdave83

    zdave83

    1) Data for backtesting comes from data subscriptions.
    2) Quotes come from an RTD feed to a real-time trade model in Excel.
    3) Orders are manually entered and executed in TWS.

    #3 is the most critical objective since I trade large baskets of options as a single "trade".
    #2 would be an upgrade from the current RTD feed ... although the RTD feed works surprisingly well!
     
  6. qlai

    qlai

    I suggest you modify your current system to connect via socket to a server. Implement some simple protocol ( buy 100 XYZ 12.35 SMART)
    Implement all the functionality that you will need to have (I would start with #3 and left rest as is). Once you have that, simply give your protocol spec to developer and ask him/her to write the server to convert your protocol into IB api and back. I suspect you will get some PMs from ET members and will be in good hands.
     
    SteveH and zdave83 like this.
  7. 2rosy

    2rosy

    its always easier to write from scratch rather than dig through someone else's example and figure out what it's doing. Looking at your list you just need to implement the callbacks in tws api
     
    d08 and zdave83 like this.
  8. zdave83

    zdave83

    qlai & 2rosy ... I appreciate the suggestions, thank you !
     
  9. We have 5yrs experience developing TWS API-based software, we can do custom jobs and have a lot of pre-made generic automation apps as well.
     
  10. zdave83

    zdave83

    Thanks for the response. I started a Private Thread.
     
    #10     Mar 17, 2019