Try explicit matches of symbol to our adhoc set for pp msgs
parent
7b86b6ae20
commit
2bc07ae05b
|
@ -1277,8 +1277,6 @@ async def stream_quotes(
|
||||||
calc_price=calc_price
|
calc_price=calc_price
|
||||||
)
|
)
|
||||||
|
|
||||||
# con = quote['contract']
|
|
||||||
# topic = '.'.join((con['symbol'], suffix)).lower()
|
|
||||||
quote['symbol'] = topic
|
quote['symbol'] = topic
|
||||||
await send_chan.send({topic: quote})
|
await send_chan.send({topic: quote})
|
||||||
|
|
||||||
|
@ -1295,12 +1293,21 @@ def pack_position(pos: Position) -> dict[str, Any]:
|
||||||
symbol = con.localSymbol.replace(' ', '')
|
symbol = con.localSymbol.replace(' ', '')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
symbol = con.symbol
|
symbol = con.symbol.lower()
|
||||||
|
|
||||||
|
exch = (con.primaryExchange or con.exchange).lower()
|
||||||
|
symkey = '.'.join((symbol, exch))
|
||||||
|
|
||||||
|
if not exch:
|
||||||
|
# attempt to lookup the symbol from our
|
||||||
|
# hacked set..
|
||||||
|
for sym in _adhoc_futes_set:
|
||||||
|
if symbol in sym:
|
||||||
|
symkey = sym
|
||||||
|
break
|
||||||
|
|
||||||
|
# TODO: options contracts into a sane format..
|
||||||
|
|
||||||
symkey = '.'.join([
|
|
||||||
symbol.lower(),
|
|
||||||
(con.primaryExchange or con.exchange).lower(),
|
|
||||||
])
|
|
||||||
return BrokerdPosition(
|
return BrokerdPosition(
|
||||||
broker='ib',
|
broker='ib',
|
||||||
account=pos.account,
|
account=pos.account,
|
||||||
|
|
Loading…
Reference in New Issue