existing order info from ibbroker
dongiulio last edited by
Because TWS sometimes disconnects and sometimes requires re-login, I need to include an occasional restart of my trading system and TWS dockers.
Because my TS is based on limit orders (and not market orders) when I restart there might be orders still pending from a previous session, I would need to extract from interactive brokers the info about the existing pending orders, so that I can manipulate them (i.e. cancel them)
I'm struggling to get this info, I've explored:
self.broker.orderswhich don't seem to be available for an IBBroker,
self.broker.ibwhich has lots of info, but don't seem to see anything order related
how could I get this info?
The existing broker doesn't implement that functionality.
Store the orders when notified in your own non-volatile (database, file, ...) and retrieve them as needed.