Commit Graph

2998 Commits (bdbc8de8c123bdfa4be14f95911344042ace53dc)

Author SHA1 Message Date
Tyler Goodlet 575b3a0605 Adjust imports 2020-12-29 18:05:36 -05:00
Tyler Goodlet 916396fbfe Move fast curve graphics to new mod 2020-12-29 18:05:36 -05:00
Tyler Goodlet 19e3db8f61 Move OHLC items into new module 2020-12-29 18:05:36 -05:00
Tyler Goodlet b4c28cb086 Start a new graphics sub-package 2020-12-29 18:05:36 -05:00
Tyler Goodlet 5d30f351af Remove use of `tractor.run()` 2020-12-29 18:05:36 -05:00
Tyler Goodlet d7f80d8ddb Add note about shm limit 2020-12-29 18:05:36 -05:00
Tyler Goodlet b467e8fd8d Try cache mode on a bunch of "static" graphics 2020-12-29 18:05:36 -05:00
Tyler Goodlet 588213a230 Add an experimental "fast appendable curve" graphic 2020-12-29 18:05:36 -05:00
Tyler Goodlet 93e76fa12c Comment some unneeded PDI optimization flags 2020-12-29 18:05:36 -05:00
Tyler Goodlet cac797a7fc Add initial pixel buffer caching usage
Leverages `QGraphicsItem.cacheMode` to speed up interactivity via
less `.paint()` calls (on mouse interaction) and redraws of the
underlying path when there are no transformations (other then a shift).
In order to keep the "flat bar on new time period" UX, a couple special
methods have to be triggered to get a redraw of the pixel buffer when
appending new data.

Use `QPainterPath.controlPointRect()` over `.boundingRect()` since
supposedly it's a lot faster. Drop all use of `QPicture` (since it seems
to conflict with the pixel buffer stuff?) and it doesn't give any
measurable speedup when drawing the "last bar" lines.

Oh, and add some profiling for now.
2020-12-29 18:05:36 -05:00
goodboy 6166e5900e
Merge pull request #131 from pikers/vwap_fsp
Vwap fsp
2020-12-29 15:43:38 -05:00
Tyler Goodlet bd73d02cfb Avoid loading volume FSPs on symbols without any data 2020-12-28 14:43:17 -05:00
Tyler Goodlet 42761438f6 Pass backfiller explicit symbol str, don't require volume ticks 2020-12-26 18:04:32 -05:00
Tyler Goodlet bc96c5847c Port to new tractor api 2020-12-21 13:02:43 -05:00
Tyler Goodlet 714c757e3e Add vwap back to fsp conf on feature branch 2020-12-21 13:02:43 -05:00
Tyler Goodlet 48da729364 Use .shield() meth name from tractor 2020-12-21 13:02:43 -05:00
Tyler Goodlet c01382294e Add signal backfilling via trio task respawn 2020-12-21 13:02:43 -05:00
Tyler Goodlet e89d3f9560 Use `numpy.divide()` to avoid divide-by-zero 2020-12-21 13:02:43 -05:00
Tyler Goodlet 7c7b31ebbe Break hist calc into wap func, use hlc3. 2020-12-21 13:02:43 -05:00
Tyler Goodlet 33515f45cc Add vwap to exposed fsp map 2020-12-21 13:02:43 -05:00
Tyler Goodlet ef2be16d97 Add initial tina (ohl3) vwap fsp 2020-12-21 13:02:43 -05:00
goodboy c5b2b6918b
Merge pull request #130 from pikers/to_qpainterpath_and_beyond
To qpainterpath and beyond
2020-12-21 13:01:27 -05:00
Tyler Goodlet 833a442ac0 Disable vwap in conf, feature delay 2020-12-19 16:57:58 -05:00
Tyler Goodlet f27d639552 Port kraken to declare "wap" field 2020-12-19 16:53:51 -05:00
Tyler Goodlet b72d7d3085 Drop profile calls on OHLC bars for now 2020-12-19 16:52:04 -05:00
Tyler Goodlet df686755da Drop legacy "historical" QPicture cruft 2020-12-19 16:51:11 -05:00
Tyler Goodlet 618c2f8e0a More general salutation 2020-12-19 16:51:03 -05:00
Tyler Goodlet db6f77481b Stick with slightly smaller fonts 2020-12-19 16:50:54 -05:00
Tyler Goodlet 7ce27107df Fix axes for shm primary indexing 2020-12-19 16:50:49 -05:00
Tyler Goodlet c8537d59a8 Port charting to new shm primary indexing 2020-12-19 16:50:38 -05:00
Tyler Goodlet 9930430721 Close app on last window exit
Use a system triggered SIGINT on app close to tear down the streaming
stack and terminate the `trio`/`tractor` runtimes deterministically.
2020-12-19 16:50:29 -05:00
Tyler Goodlet 599b5276b4 Port data apis to not touch primary index 2020-12-19 16:50:20 -05:00
Tyler Goodlet fda9fcbc55 Add historical backfilling to ib backend 2020-12-19 16:50:08 -05:00
Tyler Goodlet 6d50ad75a7 Ensure right bar x index is an int 2020-12-19 16:49:57 -05:00
Tyler Goodlet 2568a2d2e9 First draft, make graphics work on shm primary index
This is a bit hacky (what with array indexing semantics being relative
to the primary index's "start" value but it works. We'll likely want
to somehow wrap this index finagling into an API soon.
2020-12-19 16:49:43 -05:00
Tyler Goodlet 02b7d6cd19 Add prepend support to shm system 2020-12-19 16:49:35 -05:00
Tyler Goodlet 9710685508 Left align yaxis label 2020-12-19 16:49:27 -05:00
Tyler Goodlet 1f8f2eb8b3 Font size tweaks for low dpi 2020-12-19 16:06:54 -05:00
Tyler Goodlet 247b5fa2ec Tidy up doc string 2020-12-19 16:06:28 -05:00
Tyler Goodlet 3e16840566 Attempt to add numba typing and use `QGraphicsPathItem`
Failed at using either.

Quirks in numba's typing require specifying readonly arrays by
composing types manually.

The graphics item path thing, while it does take less time to write on
bar appends, seems to be slower in general in calculating the
``.boundingRect()`` value. Likely we'll just add manual max/min tracking
on array updates like ``pg.PlotCurveItem`` to squeeze some final juices
on this.
2020-12-19 16:06:22 -05:00
Tyler Goodlet 949e9d6cd1 Drop commented pixmap cruft
See #124 as to why we'll probably never need this.
2020-12-19 16:06:07 -05:00
Tyler Goodlet f083f537b1 Get `QPainterPath` "append" working
Pertains further to #109.

Instead of redrawing the entire `QPainterPath` every time there's
a historical bars update just use `.addPath()` to slap in latest
history. It seems to work and is fast. This also seems like it will be
a great strategy for filling in earlier data, woot!
2020-12-19 16:05:59 -05:00
Tyler Goodlet 413c703e34 Draw bars using `QPainterPath` magic
This gives a massive speedup when viewing large bar sets (think a day's
worth of 5s bars) by using the `pg.functions.arrayToQPath()` "magic"
binary array writing that is also used in `PlotCurveItem`.  We're using
this same (lower level) function directly to draw bars as part of one
large path and it seems to be painting 15k (ish) bars with around 3ms
`.paint()` latency. The only thing still a bit slow is the path array
generation despite doing it with `numba`. Likely, either having multiple
paths or, only regenerating the missing backing array elements should
speed this up further to avoid slight delays when incrementing the bar
step.

This is of course a first draft and more cleanups are coming.
2020-12-19 16:05:53 -05:00
Tyler Goodlet 8aede3cbcb Add field diffing on failed push 2020-12-19 16:05:22 -05:00
Tyler Goodlet f9e4e9507d Tweak axis text offset and margins 2020-12-19 15:05:37 -05:00
Tyler Goodlet c625dc90f1 Use new global var stack from tractor 2020-12-19 15:05:29 -05:00
Tyler Goodlet 9572280553 Kill the tractor tree on window close.
This makes it so you don't have to ctrl-c kill apps.
Add in the experimental openGL support even though I'm pretty sure it's
not being used much for curve plotting (but could be wrong).
2020-12-19 15:05:21 -05:00
Tyler Goodlet bfcf5170dc Add commented ex. code for line price charts 2020-12-19 15:05:14 -05:00
Tyler Goodlet acf8aeb33e Allocate space for 2d worth of 5s bars 2020-12-19 15:05:03 -05:00
Tyler Goodlet daa429f7ca Put fsp plotting into a couple tasks, startup speedups.
Break the chart update code for fsps into a new task (add a nursery) in
new `spawn_fsps` (was `chart_from_fsps`) that async requests actor
spawning and initial historical data (all CPU bound work).  For multiple
fsp subcharts this allows processing initial output in parallel
(multi-core). We might want to wrap this in a "feed" like api
eventually. Basically the fsp startup sequence is now:
- start all requested fsp actors in an async loop and wait for
  historical data to arrive
- loop through them all again to start update tasks which do chart
  graphics rendering

Add separate x-axis objects for each new subchart (required by
pyqtgraph); still need to fix hiding unnecessary ones.
Add a `ChartPlotWidget._arrays: dict` for holding overlay data distinct
from ohlc. Drop the sizing yrange to label heights for now since it's
pretty much all gone to hell since adding L1 labels. Fix y-stickies to
look up correct overly arrays.
2020-12-19 15:04:51 -05:00