binance: pass `MktPair` to `Client.bars()`
To get futures feeds correctly loading when selected from search (like 'XMRUSDT.USDTM.PERP'), expect a `MktPair` input to `Client.bars()` such that the exact venue-key can be looked up (via a new `.pair2venuekey()` meth) and then passed to `._api()`.go_httpx_no_unrelated_binance_stuff
parent
95ca44c227
commit
01a43763ed
|
@ -252,13 +252,16 @@ async def open_history_client(
|
||||||
else:
|
else:
|
||||||
client.mkt_mode = 'spot'
|
client.mkt_mode = 'spot'
|
||||||
|
|
||||||
# NOTE: always query using their native symbology!
|
array: np.ndarray = await client.bars(
|
||||||
mktid: str = mkt.bs_mktid
|
mkt=mkt,
|
||||||
array = await client.bars(
|
|
||||||
mktid,
|
|
||||||
start_dt=start_dt,
|
start_dt=start_dt,
|
||||||
end_dt=end_dt,
|
end_dt=end_dt,
|
||||||
)
|
)
|
||||||
|
if array.size == 0:
|
||||||
|
raise NoData(
|
||||||
|
f'No frame for {start_dt} -> {end_dt}\n'
|
||||||
|
)
|
||||||
|
|
||||||
times = array['time']
|
times = array['time']
|
||||||
if (
|
if (
|
||||||
end_dt is None
|
end_dt is None
|
||||||
|
|
Loading…
Reference in New Issue