paper: on no input fqme, load all mktinfos from pos table

rekt_pps
Tyler Goodlet 2023-04-05 19:34:29 -04:00
parent f42bc2dbce
commit 62259880fd
1 changed files with 21 additions and 16 deletions

View File

@ -557,24 +557,29 @@ async def trades_dialogue(
# existing brokerd daemon? # existing brokerd daemon?
# - alternatively we can possibly expect and use # - alternatively we can possibly expect and use
# a `.broker.norm_trade_records()` ep? # a `.broker.norm_trade_records()` ep?
mkt: MktPair | None = None fqmes: list[str] = [fqme]
brokermod = get_brokermod(broker) if fqme is None:
gmi = getattr(brokermod, 'get_mkt_info', None) fqmes = list(ppt.pps)
if gmi:
mkt, pair = await brokermod.get_mkt_info( for fqme in fqmes:
fqme.rstrip(f'.{broker}'), mkt: MktPair | None = None
brokermod = get_brokermod(broker)
gmi = getattr(brokermod, 'get_mkt_info', None)
if gmi:
mkt, pair = await brokermod.get_mkt_info(
fqme.rstrip(f'.{broker}'),
)
# update pos table from ledger history
ppt.update_from_trans(
ledger.to_trans(),
# NOTE: here we pass in any `MktPair` provided by the
# backend broker instead of assuming the pps.toml contains
# the correct contents!
force_mkt=mkt
) )
# update pos table from ledger history
ppt.update_from_trans(
ledger.to_trans(),
# NOTE: here we pass in any `MktPair` provided by the
# backend broker instead of assuming the pps.toml contains
# the correct contents!
force_mkt=mkt
)
pp_msgs: list[BrokerdPosition] = [] pp_msgs: list[BrokerdPosition] = []
pos: Position pos: Position
token: str # f'{symbol}.{self.broker}' token: str # f'{symbol}.{self.broker}'