From a0ce9ecc0d651d155388ad3acfefb1e390dd41a5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 17 Nov 2022 13:32:25 -0500 Subject: [PATCH] Only append con suffix if not empty --- piker/brokers/ib/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/piker/brokers/ib/api.py b/piker/brokers/ib/api.py index 2e1409fb..16fbe5e1 100644 --- a/piker/brokers/ib/api.py +++ b/piker/brokers/ib/api.py @@ -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 @@ -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