.brokers.ib random fixes-n-improvements from various other dev branches.. #27

Merged
goodboy merged 5 commits from ib_refinements into gitea_feats 2025-02-11 21:26:20 +00:00

Likely bc as i started hacking/helping with new feats introduced @ntorres i also was randomly patching in stuff from my local dev index.. 🫣

Anyway, these changes are worth factoring to a separate branch + and can be merged in before other new feats (and also hopefully won’t need to be factored into any upstream github feature branc vs. just merging gitea_feats into a refined github/master..)

Likely bc as i started hacking/helping with new feats introduced @ntorres i also was randomly patching in stuff from my local dev index.. 🫣 Anyway, these changes are worth factoring to a separate branch + and can be merged in before other new feats (and also hopefully won't need to be factored into any upstream github feature branc vs. just merging `gitea_feats` into a refined `github/master`..)
goodboy added 5 commits 2025-02-11 20:17:45 +00:00
c92a236196 ib: more trade record edge case handling
- timestamps came as `'date'`-keyed from 2022 and before but now are
  `'datetime'`..
- some symbols seem to have no commission field, so handle that..
- when no `'price'` field found return `None` from `norm_trade()`.
- add a warn log on mid-fill commission updates.
70332e375b ib: `.api` mod and log-fmt cleaning
About time we tidy'd a buncha status logging in this backend..
particularly for boot-up where there's lots of client-try-connect poll
looping with account detection from the user config.

`.api.Client` pprint and logging fmt improvements:
- add `Client.__repr__()` which shows the minimally useful set of info
  from the underlying `.ib: IB` as well as a new `.acnts: list[str]`
  of the account aliases defined in the user's `brokers.toml`.
- mk `.bars()` define a comprehensive `query_info: str` with all the
  request deats but only display if there's a problem with the response
  data.
- mk `.get_config()` report both the config file path and the acnt
  aliases (NOT the actual account #s).
- move all `.load_aio_clients()` client poll loop requests do
  `log.runtime()` statuses, only falling through to a `.warning()` when
  the loop fails to connect the client to the spec-ed API-gw addr, and
 |_ don't allow loading accounts for which the user has not defined an
    alias in `brokers.toml::[ib]`; raise a value-error in such cases
    with a message indicating how to mod the config.
 |_ only `log.info()` about acnts if some were loaded..

Other mod logging de-noising:
- better status fmting in `.symbols.open_symbol_search()` with
  `repr(Client)`.
- for `.feed.stream_quotes()` first quote reporting use `.runtime()`.
goodboy merged commit 86047824d8 into gitea_feats 2025-02-11 21:26:20 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: pikers/piker#27
There is no content yet.