Try to find cad stocks

its_happening
Tyler Goodlet 2020-08-30 12:31:32 -04:00
parent ea75281cbc
commit a345daa522
1 changed files with 8 additions and 4 deletions

View File

@ -225,18 +225,22 @@ class Client:
# use heuristics to figure out contract "type"
sym, exch = symbol.upper().split('.')
# TODO: metadata system for all these exchange rules..
if exch in ('PURE',):
currency = 'CAD'
# futes
if exch in ('GLOBEX', 'NYMEX', 'CME', 'CMECRYPTO'):
con = await self.get_cont_fute(symbol=sym, exchange=exch)
# commodities
elif exch == 'CMDTY': # eg. XAUUSD.CMDTY
con_kwargs, bars_kwargs = _adhoc_cmdty_data_map[sym]
con = ibis.Commodity(**con_kwargs)
con.bars_kwargs = bars_kwargs
# stonks
else:
# TODO: metadata system for all these exchange rules..
if exch in ('PURE', 'TSE'): # non-yankee
currency = 'CAD'
con = ibis.Stock(symbol=sym, exchange=exch, currency=currency)
try: