erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.8k stars 743 forks source link

error message:Request Timed Out #195

Closed Kagaratsch closed 4 years ago

Kagaratsch commented 4 years ago

Pretty much any bulk operation starts throwing error messages,e.g.:

Error 162, reqId 1663: Historical Market Data Service error message:Request Timed Out, contract: Stock(symbol='AZN', exchange='SMART', currency='USD')

almost immediately, and skipping operation steps. Any idea how to catch this error and resubmit the operation on the fly?

erdewit commented 4 years ago

The error message is coming from the IB backoffice. It would be up to you to see which requests succeeded and which failed and retry the ones that failed.

Kagaratsch commented 4 years ago

Yes. I mean, ideally any error message should be handled through try: and catch commands. ib_insync does not seem to catch these errors though so I'm wondering if you know how to do that manually (in terms of which error name to catch)?