IB TWS Excel API help needed

Discussion in 'Trading Software' started by MR.NBBO, May 19, 2004.

  1. MR.NBBO

    MR.NBBO

    I'm fairly computer literate.....but tying in Excel via IB's API is beyond me, I guess.

    I need a simple automated spreadsheet for IB's excel API/dde interface.

    I need it to be able to do everything that the stand alone TWS download can do in terms of functionality. Then I need my open orders to be tied to a separate cell in excel ---my "black box" cell....for which I've already created an excel spreadsheet.

    From this one cell I need orders to be adjusted at a 5min. refresh rate off of my "black box fair value" ie:, if black box formula says the stock dropped .25 in fair value, the API will cancel/replace my existing order .25 lower.

    Any guidance on obtaining/creating this kind of interface would be greatly appreciated.

    Thanks all you IB automated trading brainiacs!
     
  2. def

    def Interactive Brokers

    If you don't have luck here I suggest the following:

    1. Look at the samples provided by IB (I think you get them when you download the API.

    2. Try the IB forum on our website where other developers and/or our staff may assist.

    3. there is a yahoo IB TWS API user group that others have told me have a few very helpful members

    If all else fails, on our toolbox from our site, there is a link to external third party developers who you might be interested in contacting.
     
  3. On a computer that you have TWS installed, look under C:\Jts\excel and you'll find a file called dde.xls This file will connect to TWS. The file will take TWS data into Excel and it can send orders to TWS. You could modify the file for your own needs.

    As for a timed function in Excel I've attached an example to this post of a spreadsheet that's set to beep every 10 seconds.
     
  4. To be able to do what you want you need to go beyond computer literate and master some Excel programming in Visual Basic; or you could cough up some $$$ for some of the consultants listed on the IB site under resources->toolbox.

    If you want to delve into Excel VB for applications you can also have a look at the worksheet ondata event (deprecated and undocumented in newer Excel versions).

    Some cheap tips are available at http://www.willowsolutions.com/tips/tips.shtml (really a lot of good Excel and quote-feed processing information).
    If your literacy includes being able to copy and adjust simple code - you are in luck.
    :D
     
  5. Gringinho is right, you will have to use visual basic in Excel to do what you're talking about. I've been able to learn some of it myself but it's not that easy.

    Most times I would just do a search and find a visual basic script that I could modify for my own needs. For example, a couple of months ago I also wanted to do something on a timed interval. I did a search on google for something like: "excel macro ontime" and found this link:
    http://www.ozgrid.com/Excel/run-macro-on-time.htm
     
  6. MR.NBBO

    MR.NBBO

    Thanks for all the help & great links.

    I had a problem with my excel program (thus making this seem harder than it was).

    I keep having problems with conditional orders, the sample page from IB doesn't seem to be constructed correctly. I've seen a lot of discussion about this problem at the IB API forum. Anyone have a functioning copy they can send me?

    Always getting "required field missing" when trying to sumbit from the blue conditional orders field.