-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multichartz #420
Closed
Closed
Multichartz #420
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goodboy
force-pushed
the
agg_feedz
branch
2 times, most recently
from
November 17, 2022 20:00
e206a24
to
88979ec
Compare
goodboy
force-pushed
the
agg_feedz
branch
2 times, most recently
from
December 10, 2022 21:15
4a35fcb
to
13d81eb
Compare
This was referenced Dec 12, 2022
goodboy
force-pushed
the
agg_feedz
branch
2 times, most recently
from
January 10, 2023 16:09
791d214
to
963e5bd
Compare
goodboy
force-pushed
the
multichartz
branch
4 times, most recently
from
January 13, 2023 17:19
9589896
to
91275dc
Compare
We have this method on our `ChartPlotWidget` but it makes more sense to directly associate axis-labels with, well, the label's parent axis XD. We add `._stickies: dict[str, YAxisLabel]` to replace `ChartPlotWidget._ysticks` and pass in the `pg.PlotItem` to each axis instance, stored as `Axis.pi` instead of handing around linked split references (which are way out of scope for a single axis). More work needs to be done to remove dependence on `.chart: ChartPlotWidget` references in the date axis type as per comments.
Main "public" API change is to make `GodWidget.get/set_chart_symbol()` accept and cache-on fqsn tuples to allow handling overlayed chart groups and adjust method names to be plural to match. Wrt `LinkedSplits`, - create all chart widget axes with a `None` plotitem argument and set the `.pi` field after axis creation (since apparently we have another object reference causality dilemma..) - set a monkeyed `PlotItem.chart_widget` for use in axes that still need the widget reference. - drop feed pause/resume for now since it's leaking feed tasks on the `brokerd` side and we probably don't really need it any more, and if we still do it should be done on the feed not the flume. Wrt `ChartPlotItem`, - drop `._add_sticky()` and use the `Axis` method instead and add some overlay + axis sanity checks. - refactor `.draw_ohlc()` to be a lighter wrapper around a call to `.add_plot()`.
use the new `do_overlay_scaling: bool` since we know each feed will have its own updates (cuz multiplexed by feed..) and we can avoid ranging/scaling overlays that will make their own calls. Also, pass in the last datum "brighter" color for ohlc curves as it was originally (and now that we can pass that styling bit through).
A super snappy `numpy.median()` calculator (per input range) which we slap an `lru_cache` on thanks to handy dunder method hacks for such things on mutable types XD
Massively speeds up scaling transform cycles (duh). Also includes a draft for an "overlay transform" type/api; obviously still a WIP 🏄..
In the (incrementally updated) display loop we have range logic that is incrementally updated in real-time by streams, as such we don't really need to update all linked chart's (for any given, currently updated chart) y-ranges on calls of each separate (sub-)chart's `ChartView.interact_graphics_cycle()`. In practise there are plenty of cases where resizing in one chart (say the vlm fsps sub-plot) requires a y-range re-calc but not in the OHLC price chart. Therefore we always avoid doing more resizing then necessary despite it resulting in potentially more method call overhead (which will later be justified by better leveraging incrementally updated `Viz.maxmin()` and `media_from_range()` calcs).
It's way faster since it uses a uniform time arithmetic to narrow the `numpy.searchsorted()` range before actually doing the index search B)
This was a subtle logic error when building the `plots: dict` we weren't adding the "main (ohlc or other source) chart" from the `LinkedSplits` set when interacting with some sub-chart from `.subplots`.. Further this tries out bypassing `numpy.median()` altogether by just using `median = (ymx - ymn) / 2` which should be nearly the same?
In situations where clients are (dynamically) subscribing *while* broadcasts are starting to taking place we need to handle the `set`-modified-during-iteration case. This scenario seems to be more common during races on concurrent startup of multiple symbols. The solution here is to use another set to take note of subscribers which are successfully sent-to and then skipping them on re-try. This also contains an attempt to exception-handle throttled stream overruns caused by higher frequency feeds (like binance) pushing more quotes then can be handled during (UI) client startup.
Was broken since the `_adhoc_futes_set` rework a while back. Removes the cmdty symbols from that set into a new one and fixes the contract case block to catch `Contract(secType='CMDTY')` case. Also makes `Client.search_symbols()` return details `dict`s so that `piker search` will work again..
This was referenced Feb 2, 2023
Merged
This is going to get closed as it was replaced by a sequence of 7 (or so) smaller PRs ending with #455. Also going to make a follow issue which will include the bullet set above rewritten and checked off as we finish follow up refinement tasks. |
Replaced by the slew of PRs and follow up (copy pasted from here to start) task set in #461. |
77 tasks
51 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The UI follow up to #414.
Hopefully this is the final core-UX feature you always wanted 🏄🏼
mult-instrument overlayed real-time and historical data feeds with simultaneous interaction and "current symbol" selectable order mode control
THE CMD YOU NEED:
piker chart btcusdt.binance ethusdt.binance xmrusdt.binance
First draft TODO
There are still tons of refinements and bugs to fix as part of this first draft
Init basic funtionality / usage:
piker chart btcusdt.binance ethusdt.binance xmrusdt.binance
LinkedSplits
tab
orspace
global hotkey?)Fast view
History view
'index'
basis..pg.LinearRegion
item to show all background overlay curves transparentlyGraphics loop
Feed.open_multi_steam()
for the update task and have it look up appropriate graphics update apis per symbol-quoteChartPlotWidget
instance and API calls, instead moving all this state intoFlow
/Flume
items and possibly add aViz
type to replace theFlow
and instead make theFlow
a table of associatedsrc data -> procesor
pipelines?Search UI/UX
GodWidget
shift-click-drag-release
?) to create a group from a single/flat results tree?ctl-o
orctl-enter
on result row?)FSP (subcharts)
Order mode
fqsns: list[str]
toopen_order_mode()
and having this setup the client loop and the ems tasks to usefeed.open_feed()
with the samefqsns
passed through?