ib.api: always key `._contracts` with '.ib' suffix

So that pos msgs from the ems are correctly loaded..
ib_py311_fixes
Tyler Goodlet 2023-08-25 12:10:06 -04:00
parent 1002ce1e10
commit 461764419d
1 changed files with 5 additions and 1 deletions

View File

@ -727,12 +727,16 @@ class Client:
or tract.exchange
or exch
)
pattern: str = f'{symbol}.{exch}'
pattern: str = f'{symbol}.{exch.lower()}'
expiry: str = tract.lastTradeDateOrContractMonth
# add an entry with expiry suffix if available
if expiry:
pattern += f'.{expiry}'
# since pos update msgs will always have the full fqme
# with suffix?
pattern += '.ib'
# directly cache the input pattern to the output
# contract match as well as by the IB-internal conId.
self._contracts[pattern] = tract