Handle no matching symbols case

symbol_search
Tyler Goodlet 2021-04-10 12:20:21 -04:00
parent 36530d9cf6
commit 27aed85404
1 changed files with 23 additions and 19 deletions

View File

@ -245,6 +245,7 @@ class Client:
""" """
descriptions = await self.ib.reqMatchingSymbolsAsync(pattern) descriptions = await self.ib.reqMatchingSymbolsAsync(pattern)
if descriptions is not None:
futs = [] futs = []
for d in descriptions: for d in descriptions:
con = d.contract con = d.contract
@ -267,6 +268,9 @@ class Client:
return details return details
else:
return {}
async def search_futes( async def search_futes(
self, self,
pattern: str, pattern: str,
@ -562,7 +566,7 @@ class Client:
# default config ports # default config ports
_tws_port: int = 7497 _tws_port: int = 7497
_gw_port: int = 4002 _gw_port: int = 4002
_try_ports = [_tws_port, _gw_port] _try_ports = [_gw_port, _tws_port]
_client_ids = itertools.count() _client_ids = itertools.count()
_client_cache = {} _client_cache = {}