Commit Graph

729 Commits (vwap_backup)

Author SHA1 Message Date
Tyler Goodlet d01ca0bf96 Use .shield_channel() meth name from tractor 2020-12-17 10:53:30 -05:00
Tyler Goodlet 82c99c5fee Drop profile calls on OHLC bars for now 2020-12-17 10:53:30 -05:00
Tyler Goodlet cd0c75fe40 Add signal backfilling via trio task respawn 2020-12-17 10:53:30 -05:00
Tyler Goodlet 47959c6a2b Drop legacy "historical" QPicture cruft 2020-12-17 10:53:30 -05:00
Tyler Goodlet 873a8d3f3e More general salutation 2020-12-17 10:53:30 -05:00
Tyler Goodlet 2f36b58fbd Stick with slightly smaller fonts 2020-12-17 10:53:30 -05:00
Tyler Goodlet 642d38439d Fix axes for shm primary indexing 2020-12-17 10:53:30 -05:00
Tyler Goodlet f7f2857fe6 Port charting to new shm primary indexing 2020-12-17 10:53:30 -05:00
Tyler Goodlet 05a47c25f4 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-17 10:53:30 -05:00
Tyler Goodlet 18d41d0d24 Port kraken to declare "wap" field 2020-12-17 10:53:30 -05:00
Tyler Goodlet 098db15b2d Port data apis to not touch primary index 2020-12-17 10:53:30 -05:00
Tyler Goodlet 6bae50ba2e Add historical backfilling to ib backend 2020-12-17 10:53:30 -05:00
Tyler Goodlet 3ee4fe7d56 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-17 10:52:18 -05:00
Tyler Goodlet ec0be781f8 Add prepend support to shm system 2020-12-17 10:52:18 -05:00
Tyler Goodlet 3a70f4907a Left align yaxis label 2020-12-17 10:52:18 -05:00
Tyler Goodlet 74315d4c89 Font size tweaks for low dpi 2020-12-17 10:52:18 -05:00
Tyler Goodlet 1d7bd3f748 Use `numpy.divide()` to avoid divide-by-zero 2020-12-17 10:52:18 -05:00
Tyler Goodlet 2a933c3808 Tidy up doc string 2020-12-17 10:52:18 -05:00
Tyler Goodlet 9557292573 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-17 10:52:18 -05:00
Tyler Goodlet 2b4875957f Drop commented pixmap cruft
See #124 as to why we'll probably never need this.
2020-12-17 10:52:18 -05:00
Tyler Goodlet e36f675eee 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-17 10:52:18 -05:00
Tyler Goodlet bcce0b5df3 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-17 10:52:18 -05:00
Tyler Goodlet 4fe8c4487a Add field diffing on failed push 2020-12-17 10:52:18 -05:00
Tyler Goodlet 757f02e6f7 Tweak axis text offset and margins 2020-12-17 10:52:18 -05:00
Tyler Goodlet 80845024da Use new global var stack from tractor 2020-12-17 10:52:18 -05:00
Tyler Goodlet a5f622506d 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-17 10:52:18 -05:00
Tyler Goodlet c183a428ef Add commented ex. code for line price charts 2020-12-17 10:52:18 -05:00
Tyler Goodlet afa15c4616 Allocate space for 2d worth of 5s bars 2020-12-17 10:52:18 -05:00
Tyler Goodlet 4e8739d9ed Break hist calc into wap func, use hlc3. 2020-12-17 10:52:18 -05:00
Tyler Goodlet 0ab0957c6e 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-17 10:52:18 -05:00
Tyler Goodlet e76eb790f1 Add vwap to exposed fsp map 2020-12-17 10:52:18 -05:00
Tyler Goodlet 6d514a7d5a Add initial tina (ohl3) vwap fsp 2020-12-17 10:52:18 -05:00
Tyler Goodlet 49699a16ff Skip base metrics on no basis 2020-12-17 10:50:05 -05:00
Tyler Goodlet af61611801 Add initial selection box interaction
Requires decent modification of the built-in ``ViewBox``.
We do away with the zoom functionality for now and instead just add
a label full of some simple stats on the bounded data.
2020-11-08 16:15:34 -05:00
Tyler Goodlet 7cabb4854a Add virtualenv lines to install 2020-11-06 16:20:56 -05:00
goodboy e2d4ed063b
Merge pull request #112 from pikers/chart_hacking
Chart hacking
2020-11-06 15:42:24 -05:00
Tyler Goodlet 1972740d0c Make salotz stop grumbling like an old man 2020-11-06 15:35:10 -05:00
Tyler Goodlet 0f458f8263 Add min tick setting to axis type 2020-11-06 15:24:01 -05:00
Tyler Goodlet bdcee2b210 Readme bump 2020-11-06 13:50:59 -05:00
Tyler Goodlet c1109ee3fb Add license headers to pertinent files 2020-11-06 12:23:14 -05:00
Tyler Goodlet be4a3df7ba Add L1 spread streaming to kraken 2020-11-06 11:35:40 -05:00
Tyler Goodlet 043bc985df Configure L1 queue size precisions from history 2020-11-06 11:35:10 -05:00
Tyler Goodlet e27fece4e6 Add L1 queue size precision controls 2020-11-06 11:34:32 -05:00
Tyler Goodlet 205bedce85 Spec dpi aware font size in inches 2020-11-05 20:32:35 -05:00
Tyler Goodlet 1e491fb1bb Use pyqtgraph default pen for level lines 2020-11-05 13:23:29 -05:00
Tyler Goodlet cc88300ac5 Fix L1 updates to be like TWS
I think this gets us to the same output as TWS both on booktrader and
the quote details pane. In theory there might be logic needed to
decreases an L1 queue size on trades but can't seem to get it without
getting -ves displayed occasionally - thus leaving it for now.

Also, fix the max-min streaming logic to actually do its job, lel.
2020-11-05 12:08:29 -05:00
Tyler Goodlet db075b81ac Specialize `LevelLabel` for orientation-around-axis gymnastics 2020-11-05 12:08:02 -05:00
Tyler Goodlet 9c3850874d Add all L1 tick types for ib 2020-11-05 08:18:55 -05:00
Tyler Goodlet f438139ad7 Update L1 labels in price loop 2020-11-03 22:03:49 -05:00
Tyler Goodlet 73e54a2259 Add L1 labels wrapper type
Start a simple API for L1 bid/ask labels.
Make `LevelLabel` draw a line above/below it's text (instead of the
rect fill we had before) since it looks much simpler/slicker.
Generalize the label text orientation through bounding rect
geometry positioning.
2020-11-03 19:48:27 -05:00