Count-Down Trigger orders

Discussion in 'Interactive Brokers' started by AndyBagus, Jan 18, 2023.

  1. AndyBagus

    AndyBagus

    Hi, please, help me create an order on IB that auto-executes after x minutes.
     
  2. Are you using TWS, or using the API to submit an order?
    It is possible to give a start time to an order, meaning that it becomes active after the indicated time.
     
  3. schizo

    schizo

    Good After Time (GAT) Orders
    An order that uses the good after time/date field is held in the IB system and submitted to the market on the date and time you specify.* You must display the Good After Time field to use this time in force.

    https://www.interactivebrokers.com/en/trading/orders/gat.php

    Edit: On second thought, maybe not for "after x minutes", as you specified.
     
  4. schizo

    schizo

  5. AndyBagus

    AndyBagus

    I would be fine with triggering after x minutes.
    Best if triggering x minutes after parent order filled. No I don't use API. Open to all solutions though .
     
  6. So your initial question did not relate to any kind of order, but you want to put a time constraint on a child order after its parent got filled? I don't think that the available order type for a parent-child order allows for a time period during which the child is not active. Possibly you would have to submit the parent order first, monitor until it gets filled, and then submit the child order x minutes later.
     
  7. schizo

    schizo

    It's possible. It would be a time-based order and not price-based, but you'll likely need to program it yourself.
     
  8. 2rosy

    2rosy

    Code:
    from threading import Timer
    delayed= Timer(5, lambda: print('execute'), args=None, kwargs=None)
    delayed.start()
    in python api can use threading.Timer
     
    AndyBagus likes this.
  9. AndyBagus

    AndyBagus

    Cool, thanks!