piker/piker
Tyler Goodlet 0001f35e17 ib: add venue-hours checking
Such that we can avoid other (pretty unreliable) "alternative" checks to
determine whether a real-time quote should be waited on or (when venue
is closed) we should just signal that historical backfilling can
commence immediately.

This has been a todo for a very long time and it turned out to be much
easier to accomplish than anticipated..

Deats,
- add a new `is_current_time_in_range()` dt range checker to predicate
  whether an input range contains `datetime.now(start_dt.tzinfo)`.
- in `.ib.feed.stream_quotes()` add a `venue_is_open: bool` which uses
  all of the new ^^ to determine whether to branch for the
  short-circuit-and-do-history-now-case or the std real-time-quotes
  should-be-awaited-since-venue-is-open, case; drop all the old hacks
  trying to workaround not figuring that venue state stuff..

Other,
- also add a gpt5 composed parser to `._util` for the
  `ib_insync.ContractDetails.tradingHours: str` for before i realized
  there was a `.tradingSessions` property XD
- in `.ib_feed`,
  * add various EG-collapsings per recent tractor/trio updates.
  * better logging / exc-handling around ticker quote pushes.
  * stop clearing `Ticker.ticks` each quote iteration; not sure if this
    is needed/correct tho?
  * add masked `Ticker.ticks` poll loop that logs.
- fix some `str.format()` usage in `._util.try_xdo_manual()`

NOTE, resolved conflicts on `piker/brokers/ib/feed.py` due to
rebasing onto up stream `brokers_refinery` commit,

d809c797 `.brokers.ib.feed`: better `tractor.to_asyncio` typing and var naming throughout
2026-01-02 18:45:43 -05:00
..
accounting Spurious first-draft of EG collapsing 2026-01-02 18:22:11 -05:00
brokers ib: add venue-hours checking 2026-01-02 18:45:43 -05:00
clearing Spurious first-draft of EG collapsing 2026-01-02 18:22:11 -05:00
cli Drop old/masked ahab-docker daemon starting 2026-01-02 17:39:12 -05:00
data Spurious first-draft of EG collapsing 2026-01-02 18:22:11 -05:00
fsp Adjust to `trio`'s strict eg nurseries throughout! 2026-01-02 17:36:13 -05:00
service Adjust to `trio`'s strict eg nurseries throughout! 2026-01-02 17:36:13 -05:00
storage `.storage.cli`: collect gap-markup-aids into `tf2aids: dict` prior to pause for introspection 2025-02-19 17:01:24 -05:00
testing Pass a config `tmp_dir: Path` to the runtime when testing 2023-03-09 15:37:43 -05:00
toolz Delegate `.toolz.open_crash_handler()` to `tractor.devx` 2024-01-16 10:26:38 -05:00
tsp Spurious first-draft of EG collapsing 2026-01-02 18:22:11 -05:00
ui Adjust feed status fields/display-pane to new actor-ID 2026-01-02 17:36:13 -05:00
watchlists Add license headers to pertinent files 2020-11-06 12:23:14 -05:00
__init__.py Start `piker.service` sub-package 2023-03-09 15:37:42 -05:00
_cacheables.py Move `._cacheables.open_cached_client()` into `.brokers` pkg mod 2023-06-27 13:41:47 -04:00
calc.py Lul, adhere to returning `str`s in `humanize()` 2022-01-25 07:57:01 -05:00
config.py Mask `pytest` detection block in `piker.config` 2025-02-13 13:32:11 -05:00
log.py Group bcast errors as `Sampler.bcast_errors` 2025-02-21 16:24:54 -05:00
types.py Impl a sane (with nesting) `.types.Struct.pformat()` 2024-01-17 15:50:27 -05:00