From 941a2196b37dcfb056a3949d919ca63ca20ca829 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 17 Aug 2022 10:06:37 -0400 Subject: [PATCH] Get pos entry from table not `updated: dict` output --- piker/brokers/ib/broker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/piker/brokers/ib/broker.py b/piker/brokers/ib/broker.py index 0538540f..4a156078 100644 --- a/piker/brokers/ib/broker.py +++ b/piker/brokers/ib/broker.py @@ -547,6 +547,12 @@ async def trades_dialogue( ) continue + # XXX: not sure exactly why it wouldn't be in + # the updated output (maybe this is a bug?) but + # if you create a pos from TWS and then load it + # from the api trades it seems we get a key + # error from ``update[bsuid]`` ? + pp = table.pps[bsuid] if msg.size != pp.size: log.error( 'Position mismatch {pp.symbol.front_fqsn()}:\n'