From d25aec53e33790ef8351b9ed43b6a18284766fd4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 10 Sep 2021 11:36:46 -0400 Subject: [PATCH] Append pp values per account during startup on ib --- piker/brokers/ib.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index a2166f07..d40857a5 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -740,7 +740,7 @@ async def load_aio_clients( ) order = ports['order'] - accounts_def = config.load_accounts('ib') + accounts_def = config.load_accounts(['ib']) try_ports = [ports[key] for key in order] ports = try_ports if port is None else [port] @@ -1459,7 +1459,7 @@ async def trades_dialogue( # XXX: required to propagate ``tractor`` loglevel to piker logging get_console_log(loglevel or tractor.current_actor().loglevel) - accounts_def = config.load_accounts('ib') + accounts_def = config.load_accounts(['ib']) global _accounts2clients global _client_cache @@ -1480,7 +1480,9 @@ async def trades_dialogue( for client in _client_cache.values(): for pos in client.positions(): msg = pack_position(pos) - all_positions[msg.symbol] = msg.dict() + all_positions.setdefault( + msg.symbol, [] + ).append(msg.dict()) await ctx.started(all_positions)