Compare commits

..

No commits in common. "103967870e382205970d2d9333afec47e4c562ac" and "137aee510b09d123da515408c48d5037aa233207" have entirely different histories.

2 changed files with 10 additions and 37 deletions

View File

@ -1291,24 +1291,14 @@ async def deliver_trade_events(
case 'error':
# NOTE: see impl deats in
# `Client.inline_errors()::push_err()`
err: dict|str = item
err: dict = item
# std case, never relay errors for non-order-control
# related issues.
# never relay errors for non-broker related issues
# https://interactivebrokers.github.io/tws-api/message_codes.html
if isinstance(err, dict):
code: int = err['error_code']
reason: str = err['reason']
reqid: str = str(err['reqid'])
# XXX, sometimes you'll get just a `str` of the form,
# '[code 104] connection failed' or something..
elif isinstance(err, str):
code_part, _, reason = err.rpartition(']')
if code_part:
_, _, code = code_part.partition('[code')
reqid: str = '<unknown>'
# "Warning:" msg codes,
# https://interactivebrokers.github.io/tws-api/message_codes.html#warning_codes
# - 2109: 'Outside Regular Trading Hours'

View File

@ -251,20 +251,10 @@ async def maybe_fill_null_segments(
end_dt=end_dt,
)
if array.size == 0:
log.warning(
f'Valid gap from backend ??\n'
f'{end_dt} -> {start_dt}\n'
)
# ?TODO? do we want to remove the nulls and push
# the close price here for the gap duration?
await tractor.pause()
break
if (
frame_start_dt := (from_timestamp(array['time'][0]))
<
backfill_until_dt
frame_start_dt := (
from_timestamp(array['time'][0])
) < backfill_until_dt
):
log.error(
f'Invalid frame_start !?\n'
@ -626,17 +616,10 @@ async def start_backfill(
else:
log.warning(
f'0 BARS TO PUSH after diff!?\n'
'0 BARS TO PUSH after diff!?\n'
f'{next_start_dt} -> {last_start_dt}'
f'\n'
f'This might mean we rxed a gap frame which starts BEFORE,\n'
f'backfill_until_dt: {backfill_until_dt}\n'
f'end_dt_param: {end_dt_param}\n'
)
# XXX, to debug it and be sure.
# await tractor.pause()
break
await tractor.pause()
# Check if we're about to exceed buffer capacity BEFORE
# attempting the push