Commit Graph

1982 Commits (01cc8f347e38ecbdbe2c9aba54caae898884b3ac)

Author SHA1 Message Date
Tyler Goodlet d27214621d Update some typing and add latency checks for binance 2022-01-25 07:57:01 -05:00
goodboy ff8c33cf7e
Merge pull request #255 from pikers/multichart_ux_improvements
Multichart ux improvements
2022-01-25 07:56:04 -05:00
Tyler Goodlet 9c57f10e77 Make pause/resume feed methods sync again
We can instead use the god widget's nursery to schedule all the feed
pause/resume requests and be even more concurrent during a view (of
symbols) switch.

Use `tractor.trionics.gather_contexts()` to start up the fsp and volume
chart-displays (for an additional conc speedup). Drop `dolla_vlm` again for
now until we figure out how we can display it *and* vlm on the same
sub-chart? It would be nice to avoid having to spawn an fsp process
before showing the volume curve.
2022-01-25 07:49:47 -05:00
Tyler Goodlet 8722cf4c49 Give a single FSP subchart more space 2022-01-25 07:49:47 -05:00
Tyler Goodlet 644ac6661c Fix sidepane alignment with FSP charts
Call the resize method only after all FSP subcharts have rendered
such that the main OHLC chart's final width is read.

Further tweaks:
- drop rsi by default
- drop the stream drain stuff
- fix failed-to-read shm logging
2022-01-25 07:49:47 -05:00
Tyler Goodlet 56b65a1cde Make chart switching super fast again
This fixes a weird re-render bug/slowdown/artifact that was introduced
with the order mode sidepane work. Prior to the sidepane addition, chart
switching was immediate with zero noticeable widget rendering steps.

The slow down was caused by 2 things:
- not yielding back to the Qt loop asap after re-showing/focussing
  a linked split chart that was already in memory.
- pausing/resuming feeds only after a Qt loop render cycle has
  completed.

This now restores the near zero latency UX.
2022-01-25 07:49:47 -05:00
Tyler Goodlet f21c68a672 i dunno, but display scaling is wack 2022-01-25 07:49:46 -05:00
Tyler Goodlet c1cf4c7876 New font scaling dpi heuristics (which i don't grok) 2022-01-25 07:49:46 -05:00
Tyler Goodlet 61331fee67 Drop order status bar down a font px size 2022-01-25 07:49:46 -05:00
Tyler Goodlet e178c18745 Please please please let this dpi scaling hack work 2022-01-25 07:49:46 -05:00
Tyler Goodlet 8b12329479 Make openGL flag actually work.. 2022-01-25 07:49:46 -05:00
wattygetlood cf2d258a27 Only scale down for scale < 2 2022-01-25 07:49:46 -05:00
Tyler Goodlet 9951e1d4c9 Fix shm index update race
There was a lingering issue where the fsp daemon would sync its shm
array with the source data and we'd set the start/end indices to the
same value. Under some races a reader would then read an empty `.array`
which it wasn't expecting. This fixes that as well as tidies up the
`ShmArray.push()` logic and adds a temporary check in `.array` for zero
length if the array hasn't been written yet.

We can now start removing read array length checks in consumer code
and hopefully no more races will show up.

Revert to old shm "last" meaning last row
2022-01-25 07:49:46 -05:00
Tyler Goodlet 51373789fe Autoscale the y-range for all linked charts 2022-01-25 07:49:46 -05:00
Tyler Goodlet 51def5484e `graphics_name` is more explicit then `name` 2022-01-25 07:49:46 -05:00
Tyler Goodlet 824c81da41 Add todo for new view padding testing 2022-01-25 07:49:46 -05:00
goodboy fa2468b175
Merge pull request #253 from pikers/dolla_vlm
Dolla vlm
2022-01-25 07:47:22 -05:00
goodboy 11544dc64f
Merge pull request #252 from pikers/fspd_cluster
Fspd cluster
2022-01-25 07:46:50 -05:00
Tyler Goodlet ba7ed8b877 Add draft $_vlm doc string 2022-01-24 06:41:00 -05:00
Tyler Goodlet 8e81f8bd81 Add dollar volume fsp config section to display in subchart 2022-01-24 06:38:26 -05:00
Tyler Goodlet 0f200d9596 Revert to old shm "last" meaning last row 2022-01-24 06:30:11 -05:00
Tyler Goodlet 1f64f47ee9 Port imports to tractor's new subpkg 2022-01-24 06:27:11 -05:00
Tyler Goodlet 4c9e5feace Expose dollar volume to fsp engine
It can now be declared inside an fsp config dict under the name
`dolla_vlm`. We still need to offer an engine control that zeros
the newest sample value instead of copying from the previous.

This also litters the engine code with `pyqtgraph` profiling to see if
we can improve startup times - likely it'll mean pre-allocating a small
fsp daemon cluster at startup.
2022-01-24 06:25:29 -05:00
Tyler Goodlet 147207a0ad Add first draft of "dollar volume" fsp 2022-01-24 06:25:29 -05:00
Tyler Goodlet 119ff0ec20 Drop dollar vlm config; Add back basic vlm 2022-01-24 06:21:40 -05:00
goodboy 1c85efc63d
Merge pull request #251 from pikers/misc_ib_updates
Misc ib updates
2022-01-23 21:13:35 -05:00
Tyler Goodlet 422977d27a Port to new `tractor.trionics.maybe_open_context()` api 2022-01-23 21:01:38 -05:00
Tyler Goodlet 5b368992f6 docstr tweakz 2022-01-23 19:47:34 -05:00
Tyler Goodlet 835ad7794c Don't error on sub removal attempts, feeds need backpressure 2022-01-23 19:47:20 -05:00
Tyler Goodlet 590db2c51b Add back in vwap 2022-01-23 19:46:58 -05:00
Tyler Goodlet 94572716e6 Drop print around unshown fsp updates 2022-01-23 19:46:47 -05:00
Tyler Goodlet 00d6258a24 Stopgap: don't rerun Context.started() fsp calc task 2022-01-23 19:46:36 -05:00
Tyler Goodlet ca467f45b6 Guard against empty array read in step update task 2022-01-23 19:46:12 -05:00
Tyler Goodlet 8f023cd66f Factor out context cacher to `tractor.trionics` 2022-01-23 19:45:34 -05:00
Tyler Goodlet 162c58a8d8 Start testing out trionics helpers, put vlm before rsi 2022-01-23 19:44:09 -05:00
Tyler Goodlet 224c01e43e Spawn and cache an fsp cluster ahead of time
Use a fixed worker count and don't respawn for every chart, instead
opting for a round-robin to tasks in a cluster and (for now) hoping for
the best in terms of trio scheduling, though we should obviously route
via symbol-locality next. This is currently a boon for chart spawning
startup times since actor creation is done AOT.

Additionally,
- use `zero_on_step` for dollar volume
- drop rsi on startup (again)
- add dollar volume (via fsp) along side unit volume
- litter more profiling to fsp chart startup sequence
- pre-define tick type classes for update loop
2022-01-23 19:43:45 -05:00
Tyler Goodlet 2eef6c76d0 Start trionics mod with an `async_enter_all` 2022-01-23 19:41:57 -05:00
Tyler Goodlet 746db60e5b Increases IB api connect timeout to 1s 2022-01-23 18:18:10 -05:00
Tyler Goodlet fc3baf4bd1 Bump timeout up 2022-01-23 18:18:10 -05:00
Tyler Goodlet f1d61ac01b WIP ib: toying with showing history before first quote 2022-01-23 18:18:10 -05:00
Tyler Goodlet d69d3b319e Lengthen startup quote get timeout 2022-01-23 18:18:10 -05:00
Tyler Goodlet 0e4a7e3846 Only warn on slow quote query 2022-01-23 18:18:10 -05:00
Tyler Goodlet 0bcaeda784 Repeat the click 3 times 2022-01-23 18:18:10 -05:00
Tyler Goodlet c828261740 Activate/focus original window after feed reset 2022-01-23 18:18:10 -05:00
goodboy 4680d68824
Merge pull request #250 from pikers/single_display_update_loop
Single display update loop
2022-01-23 15:56:11 -05:00
goodboy 242d02b1cd
Merge pull request #249 from pikers/basic_vlm_display
Basic vlm display
2022-01-23 15:20:43 -05:00
Tyler Goodlet 139eca47f7 Don't push stream msgs in fsps by default 2022-01-23 12:49:06 -05:00
Tyler Goodlet 21386f6c1f Rename feed bus entrypoint 2022-01-23 12:22:37 -05:00
Tyler Goodlet 853e8d4466 Process framed ticks by type in main graphics loop
We are already packing framed ticks in extended lists from
the `.data._sampling.uniform_rate_send()` task so the natural solution
to avoid needless graphics cycles for HFT-ish feeds (like binance) is
to unpack those frames and for most cases only update graphics with the
"latest" data per loop iteration. Unpacking in this way also lessens
nested-iterations per tick type.

Btw, this also effectively solves all remaining issues of fast tick
feeds over-triggering the graphics loop renders as long as the original
quote stream is throttled appropriately, usually to the local display
rate.

Relates to #183, #192

Dirty deats:
- drop all per-tick rate checks, they were always somewhat pointless
  when iterating a frame of ticks per render cycle XD.
- unpack tick frame into ticks per frame type, and last of each type;
  the lasts are used to update each part of the UI/graphics by class.
- only skip the label update if we can't retrieve the last from from a
  graphics source array; it seems `chart.update_curve_from_array()`
  already does a `len` check internally.
- add some draft commented code for tick type classes and a possible
  wire framed tick data structure.
- move `chart_maxmin()` range computer to module level, bind a chart to
  it with a `partial.`
- only check rate limits in main quote loop thus reporting actual
  overages
- add in commented logic for only updating the "last" cleared price from
  the most recent framed value if we want to eventually (right now seems
  like this is only relevant to ib and it's dark trades: `utrade`).
- rename `_clear_throttle_rate` -> `_quote_throttle_rate`, drop
  `_book_throttle_rate`.
2022-01-23 12:19:11 -05:00
Tyler Goodlet e8cd1a0e83 Update fsps and overlays inside main OHLC chart update loop 2022-01-23 12:19:11 -05:00