IB DDE basic question

Discussion in 'Trading Software' started by MYDemaray, Aug 31, 2005.

  1. I have spent much of the day searching for a very simple answer on Elite, IB help forum and their documentation to no avail.

    Here's the issue. I am simply trying to pull my account info into the IB using DDE. The API is installed, and TWS is configured for DDE.

    I have looked at the IB example spreadsheet, etc.

    If I am creating a completely new spreadsheet with DDE link -- do I need to create some sort of connection using VBA? I am using the following formula in a cell (fictitious server):

    = mydem123|acct!id2?symbol

    The result I get is "0". I have about 40+ positions -- what am I doing wrong? Do I need to submit my acct ID in the string like so?

    = mydem123|U123456!id2?symbol

    Because that doesn't seem to work either...

    Any suggestions -- do I need to put some code in Module1 to make a connection?

    Thanks in advance for any help.

    MYD
     
  2. Bob111

    Bob111

    is your DDE connection enabled on TWS? TWS->Configure->API->Enable DDE Clients.
     
  3. yes, it works with IB's example -- but I'm having issues connecting from a new, blank worksheet.
     
  4. fader

    fader

    no, you don't need any connection via VBA and you don't need to
    change the format of your request - it should be

    = mydem123|acct!id2?symbol

    the only thing i can think about is that you have not requested the account control key first - i.e. in your blank worksheet, you must first type

    =mydem123|acct!id2?acctp? (replace id2 with id# for any other line of your portfolio)

    and then

    = mydem123|acct!id2?symbol

    good luck.



     
  5. I believe you first have to load the "Ctrl" column. It would look something like =mydem123|acct!id2?acctv?U??????
     
  6. Hmmm. I tried both of your suggestions and neither worked. Both times, the result returned was "0" to the cell. Excel is clearly communicating with the TWS, because if I alter the suggested strings I receive a "Invalid req type" error. If I enter the wrong server I get an error, so clearly I am communicating with TWS. However, it is returning "0" for everything.

    I can't figure it out :confused:

    I should mention that this is an advisor account and I am trying to access a subaccount.
     
  7. UPDATE -- I finally got it. Fader you were right. I had to use the: =mydem123|acct!id2?acctp? (replace id2 with id# for any other line of your portfolio)

    for each id# I was requesting. Previously, I was mismatching the IDs and nothing was coming up.

    Thanks for your replies!
     
  8. Sanjuro

    Sanjuro

    I just started playing around with the DDE tonight and have some questions if anyone could help.

    The Redi DDE link didn't seem as complicated as this IB DDE Link.

    How do I request the the last/high/low for a stock symbol in Excel and have it refresh every x seconds?

    I already got the sample Excel working but I want something simple and work my way up.

    seems like i have to do something like this:

    =account123|tik!id0?req?GOOG_STK_SMART_USD_ISLAND
    =account123|tik!id0?last
    =account123|tik!id0?high
    =account123|tik!id0?low

    Can I make it refresh without a macro?
    Can I put everything I one line so I don't have to do a req first and then get last/high/low after?

    Thanks!
     
  9. alanm

    alanm

    It's a real-time feed - you get updates as they happen (up to about 3x per second).

    You put one formula in each cell. You usually hide the column containing the ticker definition formulas, as the return result (0) is not useful.

    You might look at the sample spreadsheet that's part of the API package.
     
  10. Sanjuro

    Sanjuro

    Is there a certain time the id resets?

    I was playing around with it and I made the id a really large number. Since the id needs to be increasing, none of my orders are working I think because of that.

    Thanks!
     
    #10     Nov 2, 2005