DDE stock order example

Discussion in 'Automated Trading' started by TraDaToR, Mar 28, 2009.

  1. TraDaToR



    Can someone please post a working stock order for excel dde api? It's just to be sure it's the same number of" _{}" and "_0 " than on futures.

    Here's the kind of code I use for futures:


    Thanks a lot in advance.
  2. You'll need to specify the broker that you're using.
  3. TraDaToR


    Yep, sorry IB.
  4. =myname|ord!'id78539416?place?BUY_200_GE_STK_SMART_USD_LMT_16.85_{}_GTC_{}_{}_O_{}_{}_1_{}_0_0_0_0_0_0'
  5. TraDaToR


    Thanks a lot, Total Keops.

    It never works when I get t from the sample worksheet.

    Good Sunday.
  6. Can you make it work with a stock order?
    If not, can you describe what you mean by it dosen't work?
    Can you send the order and then it cancel?
    Just can't send any order?
    If it's a futures only problem I can't really be of any help, I dont trade them with the API.
  7. TraDaToR


    This time, I didn't even try to get it from the sample worksheet since it never worked in the past( i tried for futures and futures options ).

    It simply didn't transmit.

    The first time I was able to send a futures order it was an example someone gave me, I have no problem with futures orders.

    For your stock sample, if it works for you, it will work for me. I cannot try since TWS is closed for the WE.In fact, I noticed the extended attributes are different on your order, it is not just the expiry that disappears.

    Thanks again.
  8. Since the spreadsheet is not the problem then maybe you could try to have a look at the "Show Errors" button and see what it tells. I guess you already did.
    Did you make sure that the options are available in TWS?
    Did you try to direct the order to a particular market (ECBOT, CME,...) instead of smarting it?
    Is it possible that some market's dont take market orders?
    Can you get the data op the options in the Tickers page (do you have the data subscription)?
  9. TraDaToR


    Total Keops,

    I don't understand... My futures order syntax works, your stock order syntax will likely work too...

    I just wanted to get a sample stock order for coding since it is the first time I try to automate stocks.

    I don't know why when I try to get a sample out of twsdde.xls it doesn't work but as soon as I have working samples for futures, stocks and futures options, I don't care...
  10. TraDaToR


    Perhaps my twsdde files is just an old one with obsolete DDE syntax. I made my own spreadsheet for futures trading and it has worked great for 4 months. I will add stcoks soon.

    #10     Mar 29, 2009