I want to automatically cancel orders in IBKR's IB API if they are not filled after a minute. They are parent orders, so I can't just use cancelOrder after sleeping for 60 seconds or the child order will also be cancelled.
Asked
Active
Viewed 743 times
1 Answers
3
You can add a time in force condition when the order is placed.
See https://interactivebrokers.github.io/tws-api/order_conditions.html
and Interactive Brokers time-in-force order through python api
order = Order()
order.goodTillDate = "20200923 15:13:20 EST"
order.tif = "GTD"

dno
- 971
- 6
- 13
-
1This is a great answer! It's exactly what I want and the links are helpful, thank you so much! – Bryce Turner Mar 22 '22 at 09:23