Skip to content

Commit

Permalink
Only append con suffix if not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Nov 17, 2022
1 parent 9eaf21c commit 3e98166
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions piker/brokers/ib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ def con2fqsn(
case ibis.Forex() | ibis.Contract(secType='CASH'):
dst, src = con.localSymbol.split('.')
symbol = ''.join([dst, src])
suffix = con.exchange
suffix = con.exchange or 'idealpro'

# no real volume on forex feeds..
calc_price = True
Expand All @@ -1053,7 +1053,10 @@ def con2fqsn(
if expiry:
suffix += f'.{expiry}'

fqsn_key = '.'.join((symbol, suffix)).lower()
fqsn_key = symbol.lower()
if suffix:
fqsn_key = '.'.join((fqsn_key, suffix)).lower()

_cache[con.conId] = fqsn_key, calc_price
return fqsn_key, calc_price

Expand Down

0 comments on commit 3e98166

Please sign in to comment.