erdewit / ib_insync

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

A Bug when using multi accounts #197

Closed hadrianl closed 4 years ago

hadrianl commented 4 years ago

https://github.com/erdewit/ib_insync/blob/1a79398fcabe197ece8ca10f54e64ef865fae10e/ib_insync/ib.py#L1626

when i got 2 accounts and had requested "reqAccountUpdates(accounts[1])" using one client, it`s impossible to connect to TWS or IBGateway through another client because of this "Warning 2101, reqId -1: Unable subscribe to account as the following clients are subscribed to a different account.{1}"

erdewit commented 4 years ago

I would suggest to override or monkey-patch the ib.connectAsync method for your specific situation.