Source code for tensortrade.oms.wallets
from .wallet import Wallet
from .portfolio import Portfolio
_registry = {}
[docs]def get(identifier: str) -> Portfolio:
"""Gets the `TradingStrategy` that matches with the identifier.
Arguments:
identifier: The identifier for the `TradingStrategy`
Raises:
KeyError: if identifier is not associated with any `TradingStrategy`
"""
if identifier not in _registry.keys():
raise KeyError(
'Identifier {} is not associated with any `TradingStrategy`.'.format(identifier))
return _registry[identifier]