Commit Graph

550 Commits (ea75281cbc4f094708d92db43412d7771bd2de19)

Author SHA1 Message Date
Tyler Goodlet ea75281cbc Add and update y-sticky labels on new price data 2020-08-30 12:29:29 -04:00
Tyler Goodlet 86a1f33abb Start color map 2020-08-30 12:28:38 -04:00
Tyler Goodlet 649798a91f Add updateable y-sticky label 2020-08-30 12:27:41 -04:00
Tyler Goodlet 6ce8d1147e Cleanup latency tracker 2020-08-26 21:45:34 -04:00
Tyler Goodlet 0d08e39597 Refer to main chart's data for date axis 2020-08-26 21:45:13 -04:00
Tyler Goodlet 38df68935d Normalize kraken quotes for latency tracking 2020-08-26 21:44:03 -04:00
Tyler Goodlet 778e3c7b06 Properly teardown data feed on cancel 2020-08-26 21:43:21 -04:00
Tyler Goodlet 69aced7521 Add "contents" labels to charts
Add a default "contents label" (eg. OHLC values for bar charts) to each
chart and update on crosshair interaction.

Few technical changes to make this happen:
- adjust bar graphics to have the HL line be in the "middle" of the
  underlying arrays' "index range" in the containing view.
- add a label dict each chart's graphics name to a label + update routine
- use symbol names instead of this "main" identifier crap for referring to
  particular price curves/graphics
2020-08-26 21:42:11 -04:00
Tyler Goodlet bfdd2c43cc Start brokers.api module 2020-08-21 14:28:02 -04:00
Tyler Goodlet f5ad56a257 WIP initial draft of FSP subsystem
This is a first attempt at a financial signal processing subsystem which
utilizes async generators for streaming frames of numpy array data
between actors. In this initial attempt the focus is on processing price
data and relaying it to the chart app for real-time display. So far this
seems to work (with decent latency) but much more work is likely needed
around improving the data model for even better latency and less data
duplication.

Surprisingly (or not?) a lot of simplifications to the charting code
came out of this in terms of conducting graphics updates in streaming
tasks instead of hiding them inside the obfuscated mess that is the
Qt-style-inheritance-OO-90s-trash. The goal from here on wards will be
to enforce strict semantics around reading and writing of data such that
state is kept outside "object trees" as much as possible and streaming
function semantics guide our flow model. Unsurprisingly, this reduction
in "instance state" is happening wherever we use `trio` ;)

A little summary on the technical changes:
- not going to explain the fsp system yet; it's too nascent and
  probably going to get some heavy editing.
- drop any "update" methods from the `LinkedCharts` type since each
  sub-chart will have it's own update task and thus a separate update
  loop; further individual graphics (per chart) may eventually require
  this same design.
- delete `ChartView`; moved into separate mod.
- add "stream from fsp" task to start our foray into real-time actor
  processed numpy streaming.
2020-08-19 15:32:09 -04:00
Tyler Goodlet f4dddecf17 Drop weird chart type enum 2020-08-19 07:52:17 -04:00
Tyler Goodlet 20250961a6 Begin to use `@tractor.msg.pub` throughout streaming API
Since the new FSP system will require time aligned data amongst actors,
it makes sense to share broker data feeds as much as possible on a local
system. There doesn't seem to be downside to this approach either since
if not fanning-out in our code, the broker (server) has to do it anyway
(and who knows how junk their implementation is) though with more
clients, sockets etc. in memory on our end. It also preps the code for
introducing a more "serious" pub-sub systems like zeromq/nanomessage.
2020-08-19 07:51:43 -04:00
Tyler Goodlet 2f89979d8c Use partial, pass kwargs to `tractor._main()` 2020-08-19 07:41:18 -04:00
Tyler Goodlet 7acf7106df Start "interaction" module 2020-08-14 22:17:57 -04:00
Tyler Goodlet 23dcc45b63 Port monitor to normalized streams 2020-08-10 15:49:07 -04:00
Tyler Goodlet 37607d61ca Port `DataFeed` api to broker specific normalizer routine 2020-08-10 15:23:35 -04:00
Tyler Goodlet 5fe8e420b8 Add a normalizer routine which emits quote differentials/ticks 2020-08-09 00:03:09 -04:00
Tyler Goodlet 75824f7afa Future todo 2020-08-09 00:02:04 -04:00
Tyler Goodlet a1e2730aa1 Handle (far end forced) disconnects 2020-08-09 00:01:40 -04:00
Tyler Goodlet bdcf5f884b Add `services` cmd for monitoring actors 2020-08-03 21:31:56 -04:00
Tyler Goodlet e6e06a52cb Flatten out chart tasks 2020-08-02 20:10:06 -04:00
Tyler Goodlet ccf600f79a Add ravel() reference link 2020-08-02 20:09:27 -04:00
Tyler Goodlet 0389836fe6 Handle "mouse-not-on-plot" edge cases 2020-08-02 15:23:20 -04:00
Tyler Goodlet bfc1a1fcf5 Attempt more reliable chart startup
Wait for a first actual real-time quote before starting graphics update
tasks. Use the new normalized tick format brokers are expected to emit
as a `quotes['ticks']` list. Auto detect time frame from historical
bars.
2020-08-02 12:18:53 -04:00
Tyler Goodlet 3066ab216a Passthrough loglevel from qtractor 2020-08-02 12:17:38 -04:00
Tyler Goodlet 699fffd964 Trigger connection reset on slowed heartbeat 2020-08-02 12:17:03 -04:00
Tyler Goodlet f779af02f1 Drop forkserver usage.
We've got the sweet and realable `trio` spawner now :)
2020-08-02 01:42:04 -04:00
Tyler Goodlet 72d6b5b06f Trace log the heartbeat 2020-08-02 01:35:29 -04:00
Tyler Goodlet 9e4ee4d382 Pass piker log level through to tractor for chart app 2020-08-02 00:18:54 -04:00
Tyler Goodlet b743230f7f Add a couple more deps 2020-08-01 22:24:51 -04:00
Tyler Goodlet b872696d9f Set tractor loglevel in cli config 2020-08-01 22:23:19 -04:00
Tyler Goodlet 4e9057621c Drop "pipfiles"; pipenv is getting the hard boot 2020-08-01 22:22:12 -04:00
Tyler Goodlet fad58d18c9 Make ws loop restart on connection failures 2020-08-01 22:12:26 -04:00
Tyler Goodlet 06f03c690c Begin to wrap marketstore as a data feed
Wrap the sync client in an async interface in anticipation of an actual
async client. This starts support for the `open_fee()`/`stream_quotes()`
api though the tick normalization isn't correct yet.
2020-08-01 20:08:05 -04:00
Tyler Goodlet fa899c3979 Generate tick data correctly using .etime 2020-08-01 16:52:51 -04:00
Tyler Goodlet e2dab3977e Support new normalized ticks format with kraken
Generate tick datums in a list under a `ticks` field in each quote
kinda like how IB does it.
2020-07-31 00:11:17 -04:00
Tyler Goodlet bcd17d0bb6 Also log the payload 2020-07-31 00:10:47 -04:00
Tyler Goodlet e49417a4b8 Add normalization step for ticks
Start a draft normalization format for (sampled) tick data.
Ideally we move toward the dense tick format (DFT) enforced by
techtonicDB, but for now let's just get a dict of something simple
going: `{'type': 'trade', 'price': <price}` kind of thing. This
gets us started being able to real-time chart from all data feed
back-ends. Oh, and hack in support for XAUUSD..and get subactor
logging workin.
2020-07-31 00:03:17 -04:00
Tyler Goodlet 307bc87738 Fix typo 2020-07-28 14:45:18 -04:00
Tyler Goodlet 80b656e2ab Add startup logic to handle market closure 2020-07-28 14:44:32 -04:00
Tyler Goodlet b16bc9b42d Define "packetizer" in specific broker mod
Allows for formatting published quotes using a broker specific
formatting callback.
2020-07-28 14:27:51 -04:00
Tyler Goodlet 12655f87fd Support the `stream_quotes()` api in questrade backend 2020-07-20 16:58:40 -04:00
Tyler Goodlet a59497c949 Always just look up the current plot on mouse handling 2020-07-17 10:43:03 -04:00
Tyler Goodlet b97286d7f5 Allow for dynamically added plots
Add `ChartPlotWidget.add_plot()` to add sub charts for indicators which
can be updated independently. Clean up rt bar update code and drop some
legacy ohlc loading cruft.
2020-07-17 09:06:20 -04:00
Tyler Goodlet a1032a0cd7 Massively simplify the cross-hair monstrosity
Stop with all this "main chart" special treatment.
Manage all lines in the same way across all referenced plots.
Add `CrossHair.add_plot()` for adding new plots dynamically.

Just, smh.
2020-07-16 21:54:24 -04:00
Tyler Goodlet d6bd964fac Raise errors, fix module script entry 2020-07-15 13:26:48 -04:00
Tyler Goodlet 5513d48c11 Use array of names for lookup 2020-07-15 10:59:29 -04:00
Tyler Goodlet ce1c98463c Change name to qtractor 2020-07-15 09:55:09 -04:00
Tyler Goodlet 7ea6f25993 Pass broker name 2020-07-15 09:54:47 -04:00
Tyler Goodlet d431ec20a8 Override annoying stuff in ib_insync 2020-07-15 09:54:24 -04:00