Catch too-early ib hist frames
For now by REPLing them and raising an RTE inside `.ib.feed` as well as tracing any such cases that make it (from other providers) up to the `.tsp._history` layer during null-segment backfilling.multiaddrs
parent
ff502b62bf
commit
4081336bd3
|
|
@ -262,7 +262,29 @@ async def open_history_client(
|
||||||
vlm = bars_array['volume']
|
vlm = bars_array['volume']
|
||||||
vlm[vlm < 0] = 0
|
vlm[vlm < 0] = 0
|
||||||
|
|
||||||
return bars_array, first_dt, last_dt
|
# XXX, if a start-limit was passed ensure we only
|
||||||
|
# return history that far back!
|
||||||
|
if (
|
||||||
|
start_dt
|
||||||
|
and
|
||||||
|
last_dt < start_dt
|
||||||
|
):
|
||||||
|
bars_array = bars_array[
|
||||||
|
bars_array['time'] >= start_dt.timestamp()
|
||||||
|
]
|
||||||
|
# TODO! rm this once we're more confident it never hits!
|
||||||
|
breakpoint()
|
||||||
|
raise RuntimeError(
|
||||||
|
f'OHLC-bars array start is gt `start_dt` limit !!\n'
|
||||||
|
f'start_dt: {start_dt}\n'
|
||||||
|
f'last_dt: {last_dt}\n'
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
bars_array,
|
||||||
|
first_dt,
|
||||||
|
last_dt,
|
||||||
|
)
|
||||||
|
|
||||||
# TODO: it seems like we can do async queries for ohlc
|
# TODO: it seems like we can do async queries for ohlc
|
||||||
# but getting the order right still isn't working and I'm not
|
# but getting the order right still isn't working and I'm not
|
||||||
|
|
@ -451,6 +473,8 @@ async def get_bars(
|
||||||
dt_duration,
|
dt_duration,
|
||||||
) = await proxy.bars(
|
) = await proxy.bars(
|
||||||
fqme=fqme,
|
fqme=fqme,
|
||||||
|
# XXX TODO! lol we're not using this..
|
||||||
|
# start_dt=start_dt,
|
||||||
end_dt=end_dt,
|
end_dt=end_dt,
|
||||||
sample_period_s=timeframe,
|
sample_period_s=timeframe,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,13 @@ async def maybe_fill_null_segments(
|
||||||
end_dt=end_dt,
|
end_dt=end_dt,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (
|
||||||
|
from_timestamp(
|
||||||
|
array['time'][0]
|
||||||
|
) < backfill_until_dt
|
||||||
|
):
|
||||||
|
await tractor.pause()
|
||||||
|
|
||||||
# XXX TODO: pretty sure if i plot tsla, btcusdt.binance
|
# XXX TODO: pretty sure if i plot tsla, btcusdt.binance
|
||||||
# and mnq.cme.ib this causes a Qt crash XXDDD
|
# and mnq.cme.ib this causes a Qt crash XXDDD
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue