IB DDE sample spreadsheet - Order Type

Discussion in 'Interactive Brokers' started by tonyf, Feb 6, 2019.

  1. tonyf

    tonyf

  2. In order to better understand your question: what have you tried and what problems did you encounter?
     
  3. tonyf

    tonyf

    Thanks for your question.
    Have been trying to put conditional orders:
    If LMT order to buy XYZ is filled, add automatically a sell LMT order with the available quantity at a pre-defined price.
    Example: BUY LMT XYZ @1
    If/when filled
    SELL LMT XYZ @ 1.1

    Any thoughts?
     
  4. I'm not familiar with the DDE example as provided by IB.
    What you describe sounds like a bracket order to me, but without the stoploss order. There is a predefined bracket order type available.
    If you don't want to enter a bracket order then you have to modify the DDE to do the following steps:
    step 1. place the entry order (you can use the existing code)
    step 2. monitor the order status until it is filled.
    step 3. once it is filled, submit the exit order(s).
    I'm having this approach in use in my program. However, it is not DDE but Java.
     
  5. tonyf

    tonyf

    Yes, this is my fallback option.
    Rely on the Execution sheet to trigger orders.... I was hopping there was something hard-programmed by IB that we could use.
     
  6. The available orders types out-of-the-box are rather basic. Anything more fancy needs to be constructed by yourself.
     
  7. tonyf

    tonyf

    Do you have an xls/vba template you could possibly share to get me going?

    (Java and Python are out of my depth)
     
  8. No, sorry. I've never used xls/vba.