Ignore symbol-not-found errors
parent
7586e20ab4
commit
8b1c521ae9
|
@ -448,14 +448,17 @@ class Client:
|
|||
symbol=sym,
|
||||
exchange=exch,
|
||||
)
|
||||
possibles = await self.ib.qualifyContractsAsync(con)
|
||||
for i, condict in enumerate(sorted(
|
||||
map(asdict, possibles),
|
||||
# sort by expiry
|
||||
key=lambda con: con['lastTradeDateOrContractMonth'],
|
||||
)):
|
||||
expiry = condict['lastTradeDateOrContractMonth']
|
||||
results[f'{sym}.{exch}.{expiry}'] = condict
|
||||
try:
|
||||
possibles = await self.ib.qualifyContractsAsync(con)
|
||||
for i, condict in enumerate(sorted(
|
||||
map(asdict, possibles),
|
||||
# sort by expiry
|
||||
key=lambda con: con['lastTradeDateOrContractMonth'],
|
||||
)):
|
||||
expiry = condict['lastTradeDateOrContractMonth']
|
||||
results[f'{sym}.{exch}.{expiry}'] = condict
|
||||
except RequestError as err:
|
||||
log.warning(err.message)
|
||||
|
||||
return results
|
||||
|
||||
|
|
Loading…
Reference in New Issue