Excel DDE for IB's TWS API problem

Discussion in 'Automated Trading' started by travis, Nov 21, 2007.

  1. travis


    You know how some IB automated traders use Excel DDE to get data and even implement systems, through IB's TWS API?

    Well, all of a sudden today (after months working fine) it stopped working and instead of receiving data as usual, excel just freezes (in other words it hangs, it stalls...) and I get no data, but I have to terminate excel and start all over again but no avail. I can't understand what the cause might be. Maybe something else I installed.

    I tried reinstalling excel, tws, all api's versions but it still doesn't work. It happened before and I solved it with system restore, but some registry program deleted most of my restore versions so I can't do that.

    Any suggestions?
  2. esu2


    options data is missing for me..
    stocks data is there
  3. travis


    Ok, listen. I have tried to understand a little better my problem. I will tell you and maybe you can help me.

    I have two applications open: 1) excel and 2) tws, plus a 3) third application running in the background, the IB API, which tells excel how to make queries via DDE. I hope so far I got it right.

    1) Now, I reinstalled many times and many versions of Excel, so that cannot be the problem.

    2) I reinstalled many times and many versions of TWS, so I cannot have any problems from that either.

    3) I reinstalled many times and many versions of API, so that cannot be the problem either.

    The problem must be therefore in DDE, and if I knew exactly how DDE works and what files it involves, what ports and what language... I would immediately solve it. But I know nothing about it.

    Before I take up a manual and after studying it for three months I solve my problem, isn't there anyone here who can tell what could be wrong my DDE on my system?

    I tried searching on the internet, but I can't really find that many people who have had this problem - so far only two people, and their solutions didn't help me.



  4. dst

    dst Interactive Brokers

  5. travis


    All right, thanks. I did, but I will try it once more.

    I read a post that taught me that I can also press F8 to check step by step what could be wrong in the VBA. What I see is this:

    The flow of execution of macros goes back and forth between "sheet12" (request historical data) and module "util", until it stops right here in module "util":

    Function composeControlLink(server, topic, id, reqType, rawReq) As String
    composeControlLink = composeLink(server, topic, TICK_CHAR & id, reqType & QMARK & rawReq & TICK_CHAR)
    End Function


    Anyone has any ideas why? By the way both I and guy who wrote that post have the hanging problem exactly at the same spot in the code:

  6. dst

    dst Interactive Brokers

    There might a restriction on the length of the link/amount of params
  7. travis


    Well, but I didn't change anything in your sample sheet (which I am using for the historical data request), and that same sample sheet worked fine for months. I think it is a problem entirely within my computer. Somehow I installed something that is keeping DDE from working properly. I think neither excel nor IB is the cause.

    The reason I am asking everyone is that I don't want to reinstall XP all over again, if there's a way to fix it otherwise, and I think there must be.
  8. Clym


    Try uninstalling/reinstalling both the API and TWS again, but this time go and manually delete the "JTS" folder. (and don't forget to enable dde on new install)

    Are you using a modified version of the TwsDde.xls sheet? If so have you tried the getting quotes from the original TwsDde.xls?

    (Whenever I install the API, I have to do it in safe mode otherwise there is some file that cannot be accessed and the api is not fully installed)
  9. travis


    Ok, I have kind of tried already all the things you said, but I will try them again in all details you mention. Unfortunately pretty soon they will shut everything down for the weekend, so I won't know if things don't work for this reason or for the usual reason. Thanks for the advice. I feel I am getting closer to the answer. I don't want to reinstall XP - it would be a defeat.
  10. Clym


    You can work on this through the weekend using edemo account (password demouser).

    Also can you answer:
    Are you using (having freezes with) a modified version of the TwsDde.xls sheet? If so have you tried the getting quotes from the original TwsDde.xls?
    #10     Nov 23, 2007