Slapp in exchange suffix position msg key; avoid symbol aliasing on `in` check

fsp_feeds
Tyler Goodlet 2021-09-02 14:57:20 -04:00
parent fa88d91b8d
commit 28b6882725
1 changed files with 5 additions and 1 deletions

View File

@ -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),