From 2f8737af6a81cd6a75205b4e782573488750b00e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 17 Sep 2020 14:14:52 -0400 Subject: [PATCH] Fix PURE contracts lookup... --- piker/brokers/ib.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index fe68aa01..67c3e799 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -252,11 +252,21 @@ class Client: # stonks else: # TODO: metadata system for all these exchange rules.. + primaryExchange = '' + if exch in ('PURE', 'TSE'): # non-yankee currency = 'CAD' + if exch in ('PURE',): + # stupid ib... + exch = 'SMART' + primaryExchange = 'PURE' - con = ibis.Stock(symbol=sym, exchange=exch, currency=currency) - + con = ibis.Stock( + symbol=sym, + exchange=exch, + primaryExchange=primaryExchange, + currency=currency, + ) try: exch = 'SMART' if not exch else exch contract = (await self.ib.qualifyContractsAsync(con))[0]