Add symbol search to broker api
parent
1b31fcca57
commit
4d6f529d66
|
@ -1,5 +1,8 @@
|
|||
"""
|
||||
Broker high level API layer.
|
||||
Broker high level cross-process API layer.
|
||||
|
||||
This API should be kept "remote service compatible" meaning inputs to
|
||||
routines here should be
|
||||
"""
|
||||
import inspect
|
||||
from types import ModuleType
|
||||
|
@ -132,3 +135,15 @@ async def symbol_info(
|
|||
"""
|
||||
async with brokermod.get_client() as client:
|
||||
return await client.symbol_info(symbol, **kwargs)
|
||||
|
||||
|
||||
async def symbol_search(
|
||||
brokermod: ModuleType,
|
||||
symbol: str,
|
||||
**kwargs,
|
||||
) -> Dict[str, Dict[str, Dict[str, Any]]]:
|
||||
"""Return symbol info from broker.
|
||||
"""
|
||||
async with brokermod.get_client() as client:
|
||||
# TODO: support multiple asset type concurrent searches.
|
||||
return await client.search_stocks(symbol, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue