Automatic Order Entry API for IB

Discussion in 'Automated Trading' started by PeterCabus, Nov 15, 2001.

  1. Hi all,

    there seems to be a lot of confusion about DDE. DDE is a protocol based on Window messages. The protocol itself is stable and normally no data gets lost. What can happen is that your application that is responsible for processing the DDE window messages is too slow or screws up entirely. The latter happens regularly in Excel. That is why a proper DDE client (see other post: DDEClient - http://www.rhaminisys.com) can help. You could even use this client from within Excel.

    Of course there are other and better protocols available. But they would be more difficult to implement, not necessarily for IB but for us. An example of such a protocol is FIX.

    The main question is not whether DDE is stable enough. The main question is whether TWS processes the DDE requests properly. If the latter is NOT the case, then extra functionality as requested by jwcrim makes sense:
    >>
    We need be able to read the TWS order line at the application prior to Transmit.
    We need to be able to then issue a Transmit command.
    >>

    I will write code based on the DDE client to automate trading with IB (only for order management, not for quotes. I use Signal for quotes). I'm happy to share that code. The problem is that I cannot start before mid February. Those who are still interested at that time can drop me an email.

    Peter
     
    #51     Dec 14, 2001
  2. jwcrim

    jwcrim

    Whether DDE or sockets are used, I think you have to assume you will eventually lose or mangle a message. So writing the application so that key data and status is verified before actions are triggered is going to be necessary.

    I think the advantage of sockets (UDP and TCP) is that they can be implemented in any language, future language version or platform and offer a convenient way to split up CPU intensive tasks among locally networked computers.

    But you can't assume perfect communication. It is not common but possible for local UDP packets to be lost, duplicated or received out of sequence and DDE has its problems. The application must be able to sort out these problems and avoid disaster.
     
    #52     Dec 15, 2001
  3. rickty

    rickty

    vikana,

    Thanks for letting me know about the Microsoft site. VC++ 6
    itself has little documentation about DDE, however it does
    provide a number of examples, which unfortunately are long
    and are not helping me so much due to their complexity and
    lack of explanation.
    I've found very little written in books on DDE, as it seems
    to be an old technology (apparently, being replaced by Windows
    sockets). I was surprised to find on the Microsoft site some
    recently provided literature (dated August, 2001) dealing
    with the DDEML library, which appears to be the prefered way
    to go in using DDE. Apparently, there were previously some
    classes in MFC that dealt with DDE, but they appear not be
    around any more.

    If anyone comes up with a basic working scheme in VC++
    for DDE interface to TWS please let me know. My email is:
    tymerski@ee.pdx.edu.

    Richard
     
    #53     Dec 15, 2001
  4. rickty

    rickty

    The above post should be posted in the thread "IB DDE Excel: is it now possible to automate trailing orders" but for some reason having tried over 3 days now, I always
    got timed out? (Whats going on? I sent an email to elitetrader but haven't
    received a reply yet.) So I posted it here.

    Richard
     
    #54     Dec 15, 2001
  5. Actually, I'm sure there are a lot of people who are interested in that sort of thing, so instead of mailing that info to anyone, please post it on this thread. Maybe you could post the .c source file as .txt attachment.

    Does anyone know if dde can be used from within an application running in an ms-dos window?

    voodoo
     
    #55     Dec 16, 2001
  6. dozu888

    dozu888

    I tried to issue orders from the sample spreadsheet to my futures only account using the stand alone TWS, got "application defined or object defined error"

    Anybody else running into the same problem ??

    Thanks.
     
    #56     Dec 19, 2001
  7. jmk

    jmk

    Hello,

    Got the same problem (I work with french version of XL 97)

    Fixed it adding some ' : the formula should be
    ='12345'| etc..
    instead of
    =12345| etc... where 12345 is you account number.

    You can change the formula in the spreadsheet or directly in the VBA code.

    Hope this helps.

    JM
     
    #57     Dec 19, 2001
  8. dozu888

    dozu888

    Thanks !
     
    #58     Dec 19, 2001
  9. mskl

    mskl

    does anyone know how to modify orders in excel?

    I don't seem to have that macro (tws.xls!modifyOrder.modifyOrder) in excel anymore.
     
    #59     Dec 19, 2001
  10. bit2000

    bit2000

    hi,

    does anyone know the dde servername (previously 'tws', now the account number) for the current tws demo application. i don't like to playing around by my real account and the excel demo sheet.
     
    #60     Dec 20, 2001