Commit Graph

722 Commits (c8073ad89122983aff1233ea1ae89b3f052c2705)

Author SHA1 Message Date
Tyler Goodlet c8073ad891 Port kraken to declare "wap" field 2020-12-19 14:39:11 -05:00
Tyler Goodlet ffb405c74b Port data apis to not touch primary index 2020-12-19 14:39:11 -05:00
Tyler Goodlet 2bcebe779a Add historical backfilling to ib backend 2020-12-19 14:39:11 -05:00
Tyler Goodlet 4bb02ded2e Ensure right bar x index is an int 2020-12-19 14:39:11 -05:00
Tyler Goodlet 8efa2d2fc7 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 14:39:11 -05:00
Tyler Goodlet 5b8adc8881 Add prepend support to shm system 2020-12-19 14:39:11 -05:00
Tyler Goodlet 5b8e72065a Left align yaxis label 2020-12-19 14:39:11 -05:00
Tyler Goodlet c18a37c75b Font size tweaks for low dpi 2020-12-19 14:39:11 -05:00
Tyler Goodlet 36445363a0 Use `numpy.divide()` to avoid divide-by-zero 2020-12-19 14:39:11 -05:00
Tyler Goodlet 599429e54b Tidy up doc string 2020-12-19 14:39:11 -05:00
Tyler Goodlet ea8f17c94b 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 14:39:11 -05:00
Tyler Goodlet 26d1632888 Drop commented pixmap cruft
See #124 as to why we'll probably never need this.
2020-12-19 14:39:11 -05:00
Tyler Goodlet c79cbf41aa 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 14:39:11 -05:00
Tyler Goodlet 7fe62690b9 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 14:39:11 -05:00
Tyler Goodlet 46089d36c9 Add field diffing on failed push 2020-12-19 14:39:11 -05:00
Tyler Goodlet af967b333f Tweak axis text offset and margins 2020-12-19 14:39:11 -05:00
Tyler Goodlet 26adbe382c Use new global var stack from tractor 2020-12-19 14:39:11 -05:00
Tyler Goodlet cc21b0386c 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 14:39:11 -05:00
Tyler Goodlet 8695542a2a Add commented ex. code for line price charts 2020-12-19 14:39:11 -05:00
Tyler Goodlet 11a280dc10 Allocate space for 2d worth of 5s bars 2020-12-19 14:39:11 -05:00
Tyler Goodlet 1536b97b3c Break hist calc into wap func, use hlc3. 2020-12-19 14:39:11 -05:00
Tyler Goodlet a9caee17a1 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 14:39:11 -05:00
Tyler Goodlet 6188b47157 Add vwap to exposed fsp map 2020-12-19 14:39:11 -05:00
Tyler Goodlet 6a2f086bd7 Add initial tina (ohl3) vwap fsp 2020-12-19 14:39:11 -05:00
goodboy abf8b11a05
Merge pull request #118 from pikers/bar_select
Add initial selection box interaction
2020-12-19 14:35:35 -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
Tyler Goodlet 987c13c584 Classify L1 tick types 2020-11-03 16:22:04 -05:00
Tyler Goodlet a5d5208cfa Add sticky "orientation", allow overriding label draw instructions. 2020-11-03 16:21:21 -05:00
Tyler Goodlet e65f511648 Draw flat line on every new time step
Until we get a better datum "cursor" figured out just draw the flat bar
despite the extra overhead. The reason to do this in 2 separate calls is
detailed in the comment but basic gist is that there's a race between
writer and reader of the last shm index.

Oh, and toss in some draft symbol search label code.
2020-11-03 12:25:08 -05:00
Tyler Goodlet d92e02db86 Add back min window size i guess 2020-11-03 12:22:57 -05:00
Tyler Goodlet 22f1b56b36 Always update left (open) arm 2020-11-03 08:15:00 -05:00
Tyler Goodlet 1640906b09 Write shm volume (facepalm), update open=close on first volume 2020-11-03 08:14:37 -05:00
Tyler Goodlet b23e459027 Cleanup unneeded commented stuff 2020-11-02 15:43:19 -05:00