Add `ib` `Crypto` contract support

livenpaper
Tyler Goodlet 2022-08-20 18:59:53 -04:00
parent 3a9bc8058f
commit 38b190e598
2 changed files with 10 additions and 1 deletions

View File

@ -678,6 +678,13 @@ class Client:
con = ibis.Commodity(**con_kwargs) con = ibis.Commodity(**con_kwargs)
con.bars_kwargs = bars_kwargs con.bars_kwargs = bars_kwargs
# crypto$
elif exch == 'PAXOS': # btc.paxos
con = ibis.Crypto(
symbol=symbol,
currency=currency,
)
# stonks # stonks
else: else:
# TODO: metadata system for all these exchange rules.. # TODO: metadata system for all these exchange rules..

View File

@ -426,6 +426,7 @@ asset_type_map = {
'WAR': 'warrant', 'WAR': 'warrant',
'IOPT': 'warran', 'IOPT': 'warran',
'BAG': 'bag', 'BAG': 'bag',
'CRYPTO': 'crypto', # bc it's diff then fiat?
# 'NEWS': 'news', # 'NEWS': 'news',
} }
@ -722,7 +723,8 @@ async def stream_quotes(
isnan(first_ticker.last) isnan(first_ticker.last)
and type(first_ticker.contract) not in ( and type(first_ticker.contract) not in (
ibis.Commodity, ibis.Commodity,
ibis.Forex ibis.Forex,
ibis.Crypto,
) )
): ):
task_status.started((init_msgs, first_quote)) task_status.started((init_msgs, first_quote))