Tyler Goodlet
2f82db33f4
IPC primitives improvements
...
- Rename the `Client` to `Channel`
- Add better `__repr__()`
- use laddr, raddr instead of sockaddr, peer
- don't allow re-entrant `Channel.connect()` calls
- Make `Channel` an async iterable
2018-06-07 00:19:31 -04:00
Tyler Goodlet
485aa76ff6
Move ipc types into separate module
2018-05-30 12:36:23 -04:00
Tyler Goodlet
2e5cdbcb7c
Adjust to new modules
2018-05-30 09:37:53 -04:00
Tyler Goodlet
7e5e3c4cc6
Adjust reconnect coro to swallow symbol data resp
...
Couple fixes here:
- if no tickers for a watchlist name -> bail
- swallow the symbol data response in the reconnect handler coro
- don't sleep 5 seconds before connecting to subproc daemon...
Resolves #43
2018-05-17 13:20:21 -04:00
Tyler Goodlet
a05a8cc557
Include process name in log messages
2018-05-16 20:39:47 -04:00
Tyler Goodlet
84fadf7ac4
Explicitly subscribe for tickers at wl startup
2018-05-16 20:33:44 -04:00
Tyler Goodlet
186befc704
Only run 'startup sequence' on reconnect
...
When a client loses a connection it will currently need to re-subscribe
for symbols and receive a symbol data summary as a first quote response.
Only run the provided coroutine on reconnect and call the kwarg
`on_reconnect`. The client consuming code is entirely expected at this
point to know how the symbol registration protocol works.
2018-05-16 19:15:43 -04:00
Tyler Goodlet
9b34aac0fd
Build columns only for dataframe output
2018-05-09 18:09:04 -04:00
Tyler Goodlet
bcaef70612
Pack null results without raising
2018-05-09 18:09:04 -04:00
Tyler Goodlet
fd1fe0816e
Don't call formatting func on None values
2018-05-09 18:09:04 -04:00
Tyler Goodlet
3646fb4a23
Filter out bad symbols before adding client subscription
...
Event if a broker client is already spawned new clients should still
receive a detailed symbol data packet as the first response. Avoid
exposing the new client's queue to the broker (i.e. subscribing it for
quotes) until after first pushing this packet with all bad symbols
filtered out.
2018-05-09 18:09:04 -04:00
Tyler Goodlet
3a40c2f8fe
Zero bad fields
2018-05-09 18:09:04 -04:00
Tyler Goodlet
995851360d
Rx symbol data from daemon as first response
2018-05-09 18:09:04 -04:00
Tyler Goodlet
fcaeeae618
Acquire symbol data with daemon; push as first response
2018-05-09 18:09:04 -04:00
Tyler Goodlet
5a9c079c10
Support specifying daemon host address
2018-05-09 18:09:00 -04:00
Tyler Goodlet
3d6b14ec3f
Pass in the host addr
2018-05-08 15:07:13 -04:00
Tyler Goodlet
7aa99019cb
Allow adding multiple tickers via CLI
2018-04-25 09:10:57 -04:00
Tyler Goodlet
482f9531ca
Try to connect to daemon once on startup; don't poll
2018-04-22 13:27:41 -04:00
Tyler Goodlet
a2c4f0c80b
Don't recurse in Client.aiter_recv()
2018-04-22 12:48:35 -04:00
Tyler Goodlet
6a6f773477
Adjust some log levels
2018-04-20 13:18:35 -04:00
Tyler Goodlet
063dfad5b4
Make daemon registry cross-task
2018-04-20 13:18:35 -04:00
Tyler Goodlet
4f387ea2be
Fix subscriptions and connection handling
...
Oh boy where to start.
- Handle broken streams in the `StreamQueue` gracefully; terminate the
async generator.
- When a stream queue connection is unwritable discard its subscriptions
inside the quoter task
- If all subscriptions are discarded for a broker then tear down its
quoter task
- Use listener parent nursery for spawning quoter tasks
- Make broker subs data structures global/shared between conn
handler tasks
- Register the `tickers2qs` entry *after* instantiating broker client(s)
(avoids race condition when mulitple client connections are coming
online simultaneously)
- Push smoke quotes to every client not just the first that connects
- Track quoter tasks in a cross-task set
- Handle unsubscriptions more correctly
2018-04-20 13:18:35 -04:00
Tyler Goodlet
0add443e8b
Spawn broker-daemon without asking
2018-04-20 13:18:35 -04:00
Tyler Goodlet
2973b40946
Allow wl app to spawn a broker daemon in a subprocess
2018-04-20 13:18:35 -04:00
Tyler Goodlet
90e8dd911c
Daemon main doesn't require brokermod anymore
2018-04-20 13:18:35 -04:00
Tyler Goodlet
4123139750
Use `Client` in watchlist app
2018-04-20 13:18:35 -04:00
Tyler Goodlet
17feb17535
Add a reliable `Client` API
...
In order to start working toward a HA distributed
architecture make apps use a `Client` type to talk to daemons.
The `Client` provides fault-tolerance for connection failures such
that the app will continue running until a connection to the original
service can be made or the process is killed. This will make it easier
to simply spawn up new daemon child processes when faults are detected.
2018-04-20 13:18:35 -04:00
Tyler Goodlet
51b44cf236
Use msgpack for quote-packet serialization
2018-04-20 11:43:14 -04:00
Tyler Goodlet
dd5e1e7ea7
Doh, set sleeptime after adjusting the rate limit
2018-04-20 11:43:14 -04:00
Tyler Goodlet
030ecdcce8
Filter symbols and push initial quote in stream handler
...
Filter out bad symbols by processing an initial batch quote and
pushing to the subscribing client before spawning a quoter task.
This also avoids exposing the quoter task to anything but the
broker module and a `get_quotes()` routine.
2018-04-20 11:43:14 -04:00
Tyler Goodlet
02a71c51ba
Make <brokermod>.quoter() a simple factory func
2018-04-20 11:43:14 -04:00
Tyler Goodlet
a6dc697327
Move watchlist app to new daemon-socket api
2018-04-20 11:43:14 -04:00
Tyler Goodlet
0c7ecd383b
Monkey patch broker mods with a name attr
2018-04-20 11:43:14 -04:00
Tyler Goodlet
6359623019
Allow broker specific subscriptions
...
Allow client connections to subscribe for quote streams from specific
brokers and spawn broker-client quoter tasks on-demand according
to client connection demands. Support multiple subscribers to a
single daemon process.
2018-04-20 11:43:14 -04:00
Tyler Goodlet
f80735121c
Use an async generator inside `StreamQueue`
...
Async generators are faster and less code. Handle segmented packets
which can happen during periods of high quote volume. Move per-broker
rate limit logic into daemon task.
2018-04-20 11:43:14 -04:00
Tyler Goodlet
4898459bcd
Make watchlist app retrieve quotes from the broker daemon
2018-04-20 11:43:14 -04:00
Tyler Goodlet
73ef95f42a
Add `pikerd` entry point
2018-04-20 11:43:14 -04:00
Tyler Goodlet
23ae71089f
Handle dynamic symbol subscriptions in QT backend
2018-04-20 11:42:59 -04:00
Tyler Goodlet
d65bd78f5d
Add a quote stream server task
...
Add a daemon-server task for delivering subscription based
quote streams via json serialized packets wrapped in a queue
interface.
2018-04-16 02:03:22 -04:00
Tyler Goodlet
577ca43c02
Include built-in lists in show, log errors from remove
2018-04-10 14:13:00 -04:00
Tyler Goodlet
381df2815d
Expose remove errors to caller
2018-04-10 14:12:06 -04:00
Tyler Goodlet
6b72d04427
Change watchlist write function name
2018-04-06 15:07:47 -04:00
Tyler Goodlet
7e92df4352
Move built-in lists to respective module
2018-04-06 15:00:11 -04:00
Tyler Goodlet
0cccdd01b5
Only log when the network first goes down
2018-04-05 23:15:24 -04:00
K0nstantine
918133f265
Finalize WL Management and fix merge func
2018-04-04 00:35:12 -04:00
K0nstantine
49b760673e
Remove write to file from API and move to CLI
2018-04-04 00:35:12 -04:00
K0nstantine
cd69c30143
CLI tests for watchlist commands
2018-04-04 00:35:12 -04:00
K0nstantine
11f25958ba
Move watchlist api tests to seperate module
2018-04-04 00:34:42 -04:00
K0nstantine
e859222df4
Add initial API test, need relocation
2018-04-04 00:25:34 -04:00
K0nstantine
d28a3dc461
Add initial config dir test
2018-04-04 00:25:34 -04:00
K0nstantine
ce75bd8f6f
Update CLI and create watchlists module
...
Moved the watchlists management implementation to a seperate module
wrapped in an api.
Resolves : #5
2018-04-04 00:25:34 -04:00
K0nstantine
43fbea5722
Sorted values and keys in watchlist dictionary and added a purge function
2018-04-04 00:25:34 -04:00
K0nstantine
7ada8a291e
Initial watchlist management cli
2018-04-04 00:25:34 -04:00
Tyler Goodlet
e246823f2d
Add timeout handling to network poll loop
2018-04-02 14:51:38 -04:00
Tyler Goodlet
01cfbbdd64
Handle network outages
...
Quote queries will hang indefinitely when the network goes down.
Instead poll for network reestablishment such that roaming on
wifi is supported and real-time feeds will resume once the network is
back.
2018-03-31 12:02:22 -04:00
Tyler Goodlet
2b51e84a3c
Expect quotes dict in watchlist update loop
2018-03-29 13:02:03 -04:00
Tyler Goodlet
164d636c67
Handle defunct QT tickers and delays
2018-03-29 13:01:13 -04:00
Tyler Goodlet
823bd2ea29
Make payload a ticker dict
2018-03-29 13:00:48 -04:00
Tyler Goodlet
9667042fe2
Drop NUU it's now just APH
2018-03-28 14:00:17 -04:00
Tyler Goodlet
801b9f860b
Use `symbol_data()` in watclist UI
2018-03-27 16:27:55 -04:00
Tyler Goodlet
19303cf0ad
Use brokermod util functions in cli
2018-03-27 16:27:30 -04:00
Tyler Goodlet
8544c22cdc
Change `Client.symbols()` to `symbol_data()`
...
Make `symbol_data()` a common backend API method for looking up
auxiliary ticker/symbol data from brokers. It seems most have such
a call/endpoint.
2018-03-27 16:24:57 -04:00
Tyler Goodlet
8fc74c5085
Drop QT error
2018-03-27 16:16:31 -04:00
Tyler Goodlet
49d290d036
Add brokermod loader utils
2018-03-27 16:03:01 -04:00
Tyler Goodlet
29ddfe017c
Use total time calc
2018-03-23 16:15:56 -04:00
Tyler Goodlet
178e091f41
Make robinhood the default broker backend
...
- Add a rate limit cli option
- Allow broker backends to define a max quote query limit
- Add an index ETF list to demonstrate robinhood's real-time prices
2018-03-21 17:28:40 -04:00
Tyler Goodlet
200526da8a
Query QT at most 3 quotes/sec to avoid rate limits
2018-03-21 17:28:26 -04:00
Tyler Goodlet
933fe980c1
Set default quote rate to 5/sec
2018-03-21 17:27:04 -04:00
Tyler Goodlet
1ea784558c
Pass through rate arg to `poll_tickers`
2018-03-21 17:26:30 -04:00
Tyler Goodlet
456e86990f
Make watchlist app broker agnostic
2018-03-21 10:44:05 -04:00
Tyler Goodlet
6b47130c77
Move quote formatting to broker backends
2018-03-21 10:30:43 -04:00
Tyler Goodlet
f0149118e1
Specify bid-ask "stacked" cells by argument
2018-03-20 21:20:55 -04:00
Tyler Goodlet
6c0f1fbdfc
Fill failed symbol lookup df row with NaNs
2018-03-20 21:02:59 -04:00
Tyler Goodlet
48fe280e0c
Return None on failed symbol lookups
2018-03-20 21:01:55 -04:00
Tyler Goodlet
04fa3c7ca4
Factor out QT quoting specifics into the backend
2018-03-20 15:39:49 -04:00
Tyler Goodlet
42e9296b36
Adjust cli to new backend api
2018-03-20 13:28:24 -04:00
Tyler Goodlet
e75f0718a5
Add a basic quotes-only robinhood backend
...
We need a yank to test the order system and other end points that
require auth.
Resolves #2
2018-03-20 13:26:12 -04:00
Tyler Goodlet
bd7eb16ab2
Move core tasks to separate module
...
Begin abstracting out broker backends by moving core data query tasks
into a module which requires and calls a broker backend API.
2018-03-20 13:13:07 -04:00
Tyler Goodlet
56f38263be
Stack VWAP over daily high/low
2018-03-14 14:00:24 -04:00
goodboy
d2e1605bf0
Merge pull request #14 from pikers/searchbar
...
Searchbar
2018-03-07 23:52:32 -05:00
Tyler Goodlet
937285d35c
Add example watchlist your dad would want
2018-03-07 23:50:47 -05:00
Tyler Goodlet
2f34d982bc
Require symbol info for quote processing
2018-03-06 20:54:37 -05:00
K0nstantine
61206f5903
Fix issue where config dir was not created by default
...
Fixes #15
2018-03-05 19:15:10 -05:00
Tyler Goodlet
7f3ee8c728
Add really basic ticker search bar
2018-03-05 09:26:52 -05:00
Tyler Goodlet
1e7dc38a50
Drop row factories; add ticker search API
2018-03-05 09:26:52 -05:00
Tyler Goodlet
fc45e1215d
Rename as pager mod
2018-03-05 09:26:52 -05:00
goodboy
09b16bf3e7
Merge pull request #13 from pikers/kb_ctls
...
Pager support
2018-03-04 21:58:16 -05:00
Tyler Goodlet
80ee1bfc19
Poll at 3 r/s and add more detailed timing logs
2018-03-02 21:24:09 -05:00
Tyler Goodlet
13e4389c9f
Handle expired tokens more reliably; trace log json data
2018-02-22 18:44:46 -05:00
Tyler Goodlet
4b59b87f98
Add convenience methods for all log levels
2018-02-22 18:44:00 -05:00
Tyler Goodlet
6e0209ac6b
Add pager support to watchlist
2018-02-22 18:39:21 -05:00
Tyler Goodlet
385f1b9607
Add a pager widget
...
It's a `ScrollView` but with keyboard controls that allow for paging
just like the classic unix `less` program. Add a search bar widget too!
2018-02-22 18:38:50 -05:00
Tyler Goodlet
9e0f58ea6b
Add a keyboard input handling task
2018-02-17 15:09:22 -05:00
Tyler Goodlet
ff437ce9e1
Handle out of process token refreshes
2018-02-15 16:40:33 -05:00
Tyler Goodlet
b41b262b7d
Raise any unexpected error
2018-02-14 18:49:58 -05:00
Tyler Goodlet
d50aa17a83
Add real-time market caps
2018-02-14 12:06:54 -05:00
Tyler Goodlet
722d294915
Handle non-numbers in `humanize()`
2018-02-14 12:06:29 -05:00
Tyler Goodlet
722b515246
Limit humanize output to 2 decimal places
2018-02-14 02:43:55 -05:00
Tyler Goodlet
e464898210
Combine last,bid,ask in a StackLayout-cell
2018-02-14 02:37:26 -05:00
Tyler Goodlet
29be7f58c9
Push every new change; not just the last trade
2018-02-13 15:57:12 -05:00