Commit Graph

3547 Commits (emit_clear_ticks_only_on_ts_change)

Author SHA1 Message Date
Tyler Goodlet 9ea9603037 'Only emit `'trade'` ticks on msgs with new(er) timestamps from `kucoin`' 2023-04-10 23:10:48 -04:00
jaredgoldman f9d7892d69 Strip uneccesary data from ticks in l1 data feed 2023-03-27 22:53:08 -04:00
jaredgoldman a7e668f852 Ensure sub logging dict attritbutes will be there 2023-03-27 22:08:55 -04:00
jaredgoldman 8af5fe3c64 Remove breakpoints, simplify backoff logic 2023-03-27 22:01:44 -04:00
jaredgoldman ff22f2d240 Format and ensure we're only grabbing the most closest bid and ask 2023-03-27 21:51:54 -04:00
jaredgoldman 480b8c591a Add L1 data feed and correct history issue 2023-03-27 21:28:11 -04:00
jaredgoldman 79956abc5e Remove float conversion of key_id again 2023-03-24 20:23:33 -04:00
jaredgoldman 3b1078bcba Stop still converting datetime to float 2023-03-24 20:16:18 -04:00
jaredgoldman 95d127cfe0 Leave datetimes alone! 2023-03-24 20:11:59 -04:00
jaredgoldman 75eadd58f4 Add more informative logs on startup 2023-03-24 20:02:08 -04:00
jaredgoldman b72f85433a Remove breaking useless condition for determining if res is list of ohlc values 2023-03-24 19:56:38 -04:00
jaredgoldman 6c4f2cdf84 Remove float conversion for config key id 2023-03-24 18:50:21 -04:00
jaredgoldman ccfe033b7a Strengthen retry case and add comments 2023-03-20 21:24:23 -04:00
jaredgoldman 84cd7fe0e1 Add exponential retry case for history client 2023-03-20 21:14:58 -04:00
jaredgoldman 99e94f81be Make broker creds/auth optional 2023-03-19 14:48:47 -04:00
jaredgoldman 9c2177077e Remove typo 2023-03-19 14:43:51 -04:00
jaredgoldman 57587c9d2d Cast/validate streamed messages
Update comments

Minor formatting

Minor formatting
2023-03-19 14:30:26 -04:00
jaredgoldman 6e3b132239 Correct typo in license 2023-03-19 14:15:14 -04:00
jaredgoldman 4da8b7861e Label private methods accordingly, remove cryptofeeds module 2023-03-19 14:14:33 -04:00
jaredgoldman 65915832ed More cleanup, add comments re sub func 2023-03-19 13:43:35 -04:00
jaredgoldman 61bb60a810 Clean up broker code,
Add typecasting for messages/rt-data and historcal user trades
ensure we're fetching all history
add multi-symbol support
'
2023-03-19 13:43:35 -04:00
jaredgoldman a4195fccc6 Spawn background ping task 2023-03-19 13:43:35 -04:00
jaredgoldman afa68d2d59 Remove breakpoint in web_bs,
ensure we only unsub if ws is connected
2023-03-19 13:43:35 -04:00
jaredgoldman 2d3c351ca4 Implement working message streaming 2023-03-19 13:43:35 -04:00
jaredgoldman 9292e98d00 Add sub method to flow
Stash for checkout of master
2023-03-19 13:43:29 -04:00
jaredgoldman e4a78eaeef Succesfully connect to kucoin ws 2023-03-19 13:43:29 -04:00
jaredgoldman f89b408f64 Add back static API version in headers 2023-03-19 13:43:29 -04:00
jaredgoldman 88f6f89cbb Ensure we're passing the correct api version to the header builder,
make headers a default arg
2023-03-19 13:43:29 -04:00
jaredgoldman 88e51f6fde Abstract header gen to seperate function 2023-03-19 13:43:29 -04:00
jaredgoldman 2a68ce0657 Implement Kucoin auth and last trades call 2023-03-19 13:43:29 -04:00
Tyler Goodlet dc02c115ba WIP - ensure `asyncio` pumps the event loop each send 2023-03-19 13:43:13 -04:00
jaredgoldman f830a776ab Update trade message format 2023-03-19 13:27:44 -04:00
jaredgoldman 79feb1073d WIP - setup basic history and streaming client 2023-03-19 13:27:44 -04:00
jaredgoldman f3f8aeae8d Start adding history client 2023-03-19 13:27:44 -04:00
jaredgoldman be19c948a9 Add cryptofeeds data feed module,
Add Kucoin backend client
wip
2023-03-19 13:27:44 -04:00
goodboy f3b04f27e6
Merge pull request #490 from pikers/log_linearized_curve_overlays
Log linearized curve overlays
2023-03-13 15:32:42 -04:00
Tyler Goodlet 889e920796 Short-circuit rendering on no 1d-data; avoid m4 layer crash 2023-03-13 12:18:54 -04:00
Tyler Goodlet 1aab9f1f81 Actually yes, we need to handle empty in-view range.. 2023-03-10 18:20:22 -05:00
Tyler Goodlet 5c697de58e Presume never handling not-in-view case for minor curves 2023-03-10 18:20:22 -05:00
Tyler Goodlet 3066b1541e Handle (shorter supported) minor-curve not-in-view
Solve this by always scaling the y-range for the major/target curve
*before* the final overlay scaling loop; this implicitly always solve
the case where the major series is the only one in view.

Tidy up debug print formatting and add some loop-end demarcation comment
lines.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 32339cb41a Always show a minimum bars during startup
This is particularly more "good looking" when we boot with a pair that
doesn't have historical 1s OHLC and thus the fast chart is empty from
outset. In this case it's a lot nicer to be already zoomed to
a comfortable preset number of "datums in view" even when the history
isn't yet filled in.

Adjusts the chart display `Viz.default_view()` startup to explicitly
ensure this happens via the `do_min_bars=True` flag B)
2023-03-10 18:20:22 -05:00
Tyler Goodlet 12e196a6f7 Catch `KeyError` on bcast errors which pop the sub
Not sure how i missed this (and left in handling of `list.remove()` and
it ever worked for that?) after the `samplerd` impl in 5ec1a72 but, this
adjusts the remove-broken-subscriber loop to catch the correct
`set.remove()` exception type on a missing (likely already removed)
subscription entry.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 8a87e5f390 Remove leftover debug print in cache reset meth 2023-03-10 18:20:22 -05:00
Tyler Goodlet 5958acebe1 Add (commented) draft 1min OHLC time index logging
For the purposes of eventually trying to resolve last-step indexing
synchronization (an intermittent but still existing) issue(s) that can
happen due to races during history frame query and shm writing during
startup. In fact, here we drop all `hist_viz` info queries from the main
display loop for now anticipating that this code will either be removed
or improved later.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 8d1c713a5a Always pass step to `slice_from_time()` in view mode
Again, as per the signature change, never expect implicit time step
calcs from overlay processing/machinery code. Also, extend the debug
printing (yet again) to include better details around
"rescale-due-to-minor-range-out-of-view" cases and a detailed msg for
the transform/scaling calculation (inputs/outputs), particularly for the
cases when one of the curves has a lesser support.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 32926747c6 Always pass `step` to `slice_from_time()` in the `Viz`
As per the change to `slice_from_time()` this ensures this `Viz` always
passes its self-calculated time indexing step size to the time slicing
routine(s).

Further this contains a slight impl tweak to `.scalars_from_index()` to
slice the actual view range from `xref` to `Viz.ViewState.xrange[1]` and
then reading the corresponding `yref` from the first entry in that
array; this should be no slower in theory and makes way for further
caching of x-read-range to `ViewState` opportunities later.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 712f1a47a0 Require `step: float` input to `slice_from_time()`
There's been way too many issues when trying to calculate this
dynamically from the input array, so just expect the caller to know what
it's doing and don't bother with ever hitting the error case of
calculating and incorrect value internally.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 51f3733487 Handle "target-is-shorter-then-pinned" case
When the target pinning curve (by default, the dispersion major) is
shorter then the pinned curve, we need to make sure we find still find
the x-intersect for computing returns scalars! Use `Viz.i_from_t()` to
accomplish this as well and, augment that method with a `return_y: bool`
to allow the caller to also retrieve the equivalent y-value at the
requested input time `t: float` for convenience.

Also tweak a few more internals around the 'loglin_ref_to_curve'
method:
- only solve / adjust for the above case when the major's xref is
  detected as being "earlier" in time the current minor's.
- pop the major viz entry from the overlay table ahead of time to avoid
  a needless iteration and simplify the transform calc phase loop to
  avoid handling that needless cycle B)
- add much better "organized" debug printing with more clear headers
  around which "phase"/loop the message pertains and well as more
  explicit details in terms of x and y-range values on each cycle of
  each loop.
2023-03-10 18:20:22 -05:00
Tyler Goodlet 4bb580ae60 Don't `@lru_cache` on `Viz.i_from_t()`, since view state.. 2023-03-10 18:20:22 -05:00
Tyler Goodlet 05aee4a311 Tweak debug printing to display y-mxmn per viz 2023-03-10 18:20:22 -05:00