Help - Speed Up my process of TWS Conditional orders

Discussion in 'Interactive Brokers' started by gaz0001, Jan 15, 2022.

  1. gaz0001

    gaz0001

    Hi IB and TWS users,

    Can you help me speed up my process.

    There is a trade that I like to do, which takes me around 45s to repeat. Since I do this trade several times a day, I was hoping for some hinr, tips, shortcuts to speed it up.

    Scenario - im looking at the SPY chart.
    I buy SPY Call at $x
    Now I want to set a bracket order to sell at $y (Low) or $z (High).
    My sell prices are based on Underlying SPY, not option prices.

    My Process.
    Right click on the SPY call in the portfolio and select order ticket.
    Fill the order ticket to sell position at MKT.

    Two conditions - Price = < SPY $y OR price > SPY $z.

    Transmit.



    I do this 10x per day and its tedious.

    To simplify it, all I want to do is a STP MKT for my SPY options based on the underlying SPY.

    Thanks in advanced if you can help.
    Even bringing up order ticket usually takes 10s to load.
     
  2. I was in a similar situation a couple of years ago. The solution I found at that time was to place the opening trade manually in TWS. Once the order got filled I ran some software code, using IB's API, which would automatically calculate the limit prices and place the profit taker and stoploss orders around this open position. That worked much smoother, and with much lower chance of errors, than manually placing those exit orders in TWS.
     
    Burtis and gaz0001 like this.
  3. gaz0001 likes this.
  4. gaz0001

    gaz0001

    I don't have much programming skills actually.
    I was kinda looking for a TWS hotkey solution or something.
     
  5. Burtis

    Burtis

    Hi Hobby,

    Did this automatically attach itself to your open order after it was filled? or did you have to actively monitor your fill and then run the script? I am not really familiar with this kind of thing at all but I am new to IBKR and trying to figure out how it works. I am attempting to do something similar to the above post, where I buy a contract based on the underlying <= or => my level. I then would like to sell the option once I reach profit targets (15%, 25%, 35%) or stop out with a 15% hard stop. Is that something that I would need to program in API or is that possible with the current default in IBKR?
     
  6. I kept my software simple, thus it did not monitor for the order to be filled and attach itself. I didn't want to over-complicate things. So I placed the opening order manually and watched it until it got filled. Then I ran the program (started it manually). It would find the open position and create the two closing orders with the limit prices set according to my pre-defined settings. In my case were those settings pretty simple: x% above and y% below the execution price of the opened position. The two closing orders were placed as a one-cancels-other group: if one of the two orders triggered, the other one would automatically be cancelled by IB.
    In your case it would be one step more complicated because you first want to determine the current price of the underlying, and then base your limit prices for the option closing orders off of this underlying price and the option's opening execution price. Although this may sound complicated if you are not experienced with the API software, it is in fact pretty straightforward to implement. In fact, anything that you can describe on paper in a set of fixed rules you can implement in software with the API.
    I am not very familiar with TWS, but I don't think you can attach closing orders to an existing open position with prices based on a third (e.g. underlying) instrument's price.