From 28b68827255b3f96ae53d78996452c6453acb0a5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 2 Sep 2021 14:57:20 -0400 Subject: [PATCH] Slapp in exchange suffix position msg key; avoid symbol aliasing on `in` check --- piker/brokers/ib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index 85a34527..a4eba51c 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -1295,10 +1295,14 @@ def pack_position(pos: Position) -> dict[str, Any]: else: symbol = con.symbol + symkey = '.'.join([ + symbol.lower(), + (con.primaryExchange or con.exchange).lower(), + ]) return BrokerdPosition( broker='ib', account=pos.account, - symbol=symbol, + symbol=symkey, currency=con.currency, size=float(pos.position), avg_price=float(pos.avgCost) / float(con.multiplier or 1.0),