Replies: 1 comment
|
Correction to my own post — two things above are imprecise, and one of them is simply wrong. Sorry for the noise. 1. The log levels are wrong as I stated them. I wrote that the failure "is logged at except TimeoutError as e:
self._log.debug(msg) if suppress_timeout_warning else self._log.warning(msg)
...
return default_value
except ConnectionError as e:
self._log.error(f"Connection error during {request}; ending request")
...
return default_valueOnly the downstream summary in 2. The multi-segment path needs if duration:
return [(end_date, duration)]So a caller passing What I think still stands: with Apologies for not checking the log levels before posting. |
Uh oh!
There was an error while loading. Please reload this page.
Context
I'm using
HistoricInteractiveBrokersClient.request_bars()on v1.230.0 to build daily-bar research datasets. I hit a case where the returned series was shorter than the requested window with no error raised, and traced it to the chunking loop.Before opening an issue I'd like to check whether this is considered v1-legacy-only, since #4484 and #4485 were recently closed on that basis.
What I observe (v1.230.0)
nautilus_trader/adapters/interactive_brokers/data.py,get_historical_bars_chunked:and
client/client.py,_await_request:So when a segment times out or hits a connection error, the failure becomes an empty list, the loop logs at
INFO— the same line a genuinely empty window produces — and continues to the next segment.request_barsthen doesif bars: data.extend(bars)and returns the sorted survivors.The result is well-formed, sorted, and short. Nothing in the return value or the exception behaviour distinguishes "IB has no data for that window" from "that segment failed".
Why this one seems worth raising
HistoricInteractiveBrokersClientis the research/backfill utility, so its output typically gets persisted and then used as the input to backtests. A silently short dataset doesn't produce a visible failure — it produces a plausible-looking backtest over less history than intended. If the shortfall lands at either edge of the requested window, it is also not detectable from the returned data alone, since the delivered series is internally contiguous.v2 appears to already handle this
crates/adapters/interactive_brokers/src/historical/client.rsondevelop:The
??propagates rather than continuing, so a failed segment aborts the request with an error instead of yielding a partial result.Question
Given that #4484 and #4485 were closed as v1-legacy with v1 retirement imminent:
I've raised this as a discussion rather than an issue because I suspect the answer is (1), but the silent-shortfall behaviour seemed worth having on the record somewhere searchable. Thanks for all the work on this project.
All reactions