ib: Solve lingering bugs for non-vlm contracts

Contract matching in live setup was borked; switch to
`MktPair.dst.atype` matching, don't override the `cmdty` "venue" (a
weird special case) in `get_mkt_info()` otherwise lookup will fail..
master
Tyler Goodlet 2023-05-24 09:11:24 -04:00
parent e8787d89c6
commit 9a063ccb11
1 changed files with 11 additions and 7 deletions

View File

@ -803,7 +803,11 @@ async def get_mkt_info(
init_info: dict = {}
atype = _asset_type_map[con.secType]
venue = con.primaryExchange or con.exchange
if atype == 'commodity':
venue: str = 'cmdty'
else:
venue = con.primaryExchange or con.exchange
price_tick: Decimal = Decimal(str(details.minTick))
if atype == 'stock':
@ -918,12 +922,12 @@ async def stream_quotes(
# it might be outside regular trading hours so see if we can at
# least grab history.
if (
isnan(first_ticker.last)
and type(first_ticker.contract) not in (
ibis.Commodity,
ibis.Forex,
ibis.Crypto,
)
isnan(first_ticker.last) # last quote price value is nan
and mkt.dst.atype not in {
'commodity',
'forex',
'crypto',
}
):
task_status.started((init_msgs, first_quote))