Commit Graph

810 Commits (3ebb7ab6b16e6a48e370a50587ebdcab999ce383)

Author SHA1 Message Date
Tyler Goodlet 17b66e685f Experiment with zoom focal @ L1 edge 2021-03-17 08:25:58 -04:00
Tyler Goodlet d1c8c2a072 More level line reworking
- break (custom) graphics item style marker drawing into separate func
 but keep using it since it still seems oddly faster then the
 QGraphicsPathItem thing..
- unfactor hover handler; it was uncessary
- make both the graphics path item and custom graphics items approaches
  both work inside ``.paint()``
2021-03-16 19:36:05 -04:00
Tyler Goodlet adf6437449 Move margin settings to class scope 2021-03-16 15:59:44 -04:00
Tyler Goodlet 61198818dc Fix label snap on line highlight bug 2021-03-14 12:28:11 -04:00
Tyler Goodlet cf2f001bcc Add save last datum toggle to y-label 2021-03-13 21:06:53 -05:00
Tyler Goodlet 776395791a Pass action to line editor 2021-03-13 19:31:22 -05:00
Tyler Goodlet c75dacb239 Support func ops on field data, extend anchor logics 2021-03-13 19:29:52 -05:00
Tyler Goodlet c71a3e0fc5 Level line look and feel rework
Add support for drawing ``QPathGraphicsItem`` markers but don't use them
since they seem to be shitting up when combined with the infinite line
(bounding rect?): weird artifacts and whatnot. The only way to avoid
said glitches seems to be to update inside the infinite line's
`.paint()` but that slows stuff down.. Instead stick with the manual
paint job use the same pin point: left of the L1 spread graphics - where
the lines now also extend to.

Further stuff:
- Pin the y-label to a line's value on hover.
- Disable x-dimension line moving
- Rework the labelling to be more minimal
2021-03-13 17:31:15 -05:00
Tyler Goodlet 887c305d46 Allow y-label pinning on cross hair hide 2021-03-13 17:29:35 -05:00
Tyler Goodlet 9798689961 Lengthen label arrow a tad 2021-03-13 17:28:57 -05:00
Tyler Goodlet f6dbdfab84 Don't crash on unknown orders execing 2021-03-13 17:28:22 -05:00
Tyler Goodlet 396f6b2a0d Fix type annot 2021-03-12 07:41:47 -05:00
Tyler Goodlet 18ab81a967 Make crosshair lines a milder gray 2021-03-11 21:44:35 -05:00
Tyler Goodlet 624617d8e1 Don't run brokerds in debug mode by default 2021-03-11 21:44:10 -05:00
Tyler Goodlet d016abcd0d Adjust right axis anchor closure to include l1 label size 2021-03-11 21:43:29 -05:00
Tyler Goodlet 4a1df686a5 Update max l1 label size on chart 2021-03-11 21:42:38 -05:00
Tyler Goodlet a51d5c536e Add a couple more grays 2021-03-11 21:41:13 -05:00
Tyler Goodlet 31c14a2f9f Add l1 label size tracking to chart widget 2021-03-11 21:40:50 -05:00
Tyler Goodlet ea8120156f Add position line updating to order mode 2021-03-11 21:40:06 -05:00
Tyler Goodlet e91e7bea1f Add position event support to ems 2021-03-11 21:38:59 -05:00
Tyler Goodlet 6265ae8057 Add position event relay to ib broker backend 2021-03-11 21:38:31 -05:00
Tyler Goodlet 98bfee028a Add a position line api
Add a line which shows the current average price position with and arrow
marker denoting the direction (long or short). Required some further
rewriting of the infinite line from pyqtgraph including:
- adjusting marker (arrow) placement to be offset from axis + l1 labels
- fixing the hover event to not require the `.movable` attribute to be
  set
2021-03-11 21:35:09 -05:00
Tyler Goodlet 7075a968b4 Create an order mode module 2021-03-08 09:05:37 -05:00
Tyler Goodlet 7e214180a6 Remove old simulated order price on update 2021-03-07 22:17:19 -05:00
Tyler Goodlet fff9efe4aa Snap level line movements to tick size 2021-03-07 22:16:46 -05:00
Tyler Goodlet d58a82bd38 Factor and simplify paper clearing logic 2021-03-07 16:41:14 -05:00
Tyler Goodlet 5deea50963 Factor order request processing into new func 2021-03-07 16:25:47 -05:00
Tyler Goodlet e71bcb363c Drop stage line cacheing; the complexity isn't worth it. 2021-03-07 16:07:23 -05:00
Tyler Goodlet de5a69c59c Add mouse drag order update support to UI 2021-03-07 16:01:42 -05:00
Tyler Goodlet 6851bacd0a Add drag start/end callback support, remove from cursor hovered on delete 2021-03-07 15:50:50 -05:00
Tyler Goodlet 0ade7daebc Support simulated live order modification in paper engine 2021-03-07 13:34:03 -05:00
Tyler Goodlet 919ecab732 Support order modification in ems request loop 2021-03-07 13:12:39 -05:00
Tyler Goodlet a43ab1b983 Add order update method to client 2021-03-07 10:56:09 -05:00
Tyler Goodlet 2cabe1831c Attempt to handle existing order updates with ib backend 2021-03-06 16:33:56 -05:00
Tyler Goodlet a1a1dec885 Move L1 labels into lone module 2021-03-01 14:48:08 -05:00
Tyler Goodlet 8997b6029b Drop cruft 2021-03-01 12:02:07 -05:00
Tyler Goodlet 72c4a4366b Tag TWS trade events 2021-03-01 12:01:48 -05:00
Tyler Goodlet a1691cf1c5 Keep to one EMS daemon if possible 2021-03-01 11:28:44 -05:00
Tyler Goodlet 327129db37 Drop paper limit submissions for alerts 2021-02-25 18:44:40 -05:00
Tyler Goodlet 9f9b5480a6 More explicit private var name 2021-02-24 12:05:09 -05:00
Tyler Goodlet 948e133cae Split out ems daemon, client api and paper engine into new mods 2021-02-22 18:37:57 -05:00
Tyler Goodlet a9bbc223bb Add a new exchange subpackage 2021-02-22 17:28:34 -05:00
Tyler Goodlet 1142a538ea Don't forward errors without an order id 2021-02-22 10:45:01 -05:00
Tyler Goodlet e6ea053d40 Get kivy/questrade shit working again 2021-02-21 12:32:40 -05:00
Tyler Goodlet f724798336 Fix incorrect bounding rect calc 2021-02-21 12:02:20 -05:00
Tyler Goodlet 4b0e5662a5 Add default order lot sizes by asset type 2021-02-21 12:01:48 -05:00
Tyler Goodlet 6fb1945360 Fix and pass through piker loglevel correctly 2021-02-21 11:50:33 -05:00
Tyler Goodlet aa4a2ef64f Bump up font size one more time 2021-02-21 11:49:27 -05:00
Tyler Goodlet c2890b8197 Port level line to xhair methods 2021-02-21 11:48:51 -05:00
Tyler Goodlet d5b41e12c5 Add crosshair hide/show convenience methods 2021-02-21 11:45:24 -05:00
Tyler Goodlet 71745ddcd4 Even smaller text fill on axes 2021-02-21 11:44:58 -05:00
Tyler Goodlet 8c757d0bdd Accept a symbol type key from broker 2021-02-21 11:42:19 -05:00
Tyler Goodlet 38b2e99002 Fill clearable prices asap 2021-02-20 16:43:33 -05:00
Tyler Goodlet d8b157d209 First draft paper trading engine!
It's a super naive implementation with no slippage model or network
latency besides some slight delays. Clearing only happens on bid/ask
sweep ticks at the moment - simple last volume based clearing coming
up next.
2021-02-20 15:25:53 -05:00
Tyler Goodlet ead2f77d40 Add a symbol/asset type key 2021-02-19 18:43:56 -05:00
Tyler Goodlet add63734f1 Add an auto-reconnect websocket API 2021-02-19 18:42:50 -05:00
Tyler Goodlet bbd54e8f95 Report asset types, tick sizes, and order actions from ib 2021-02-19 17:23:37 -05:00
Tyler Goodlet 1ac4cc3dd3 Use new field label api for L1 2021-02-16 06:42:48 -05:00
Tyler Goodlet 880bdcffa7 Document order status list from ib 2021-02-12 09:07:49 -05:00
Tyler Goodlet b794855ad3 Port order mode to new order line api 2021-02-11 23:42:57 -05:00
Tyler Goodlet d91f07c947 Drop old candlestick graphics code 2021-02-11 23:42:17 -05:00
Tyler Goodlet aec8f1d25c Hide y-label on level line mouse over 2021-02-11 23:41:40 -05:00
Tyler Goodlet bf78c13df4 Attempt px perfection on crosshair lines placement 2021-02-11 14:03:47 -05:00
Tyler Goodlet f51e503e47 Support arbitrary fields (with update) in labels
This turned into a larger endeavour then intended but now we're using our
own label system on level lines to be able to display things nicely
**pinned wherever we want in the UI**. Keep the old ``LevelLabel`` for
now for the L1 graphics but we'll likely replace this as well since i'm
pretty sure the new label type (which wraps `QGraphicsTextItem`) is more
performant anyway.
2021-02-11 13:59:50 -05:00
Tyler Goodlet cbf259f3f3 Add hidpi issue regarding it being borky 2021-02-11 11:49:33 -05:00
Tyler Goodlet ca576ca3cf Add label delete method 2021-02-11 11:49:01 -05:00
Tyler Goodlet 0edca84b3d Yet another font size tweak 2021-02-11 11:48:40 -05:00
Tyler Goodlet dd1aed627e Tidy axis code 2021-02-11 11:48:19 -05:00
Tyler Goodlet 02edfdf846 Pass order size to ems 2021-02-11 11:47:34 -05:00
Tyler Goodlet 21e1561a57 Add a sane label type..smh 2021-02-11 00:12:37 -05:00
Tyler Goodlet 386cd9404d Drop hidpi detection? it doesn't seem to yield benefits 2021-02-08 07:07:04 -05:00
Tyler Goodlet ac84087755 Fix stage line updating, size up arrow heads? 2021-02-08 07:06:00 -05:00
Tyler Goodlet 0449734c53 Drop YSticky for level lines stuff 2021-02-08 07:04:08 -05:00
Tyler Goodlet 1ef2d18a41 Try to make crosshair lines px perfect 2021-02-08 07:03:28 -05:00
Tyler Goodlet 708ed89894 Hard code font inches 2021-02-08 07:01:26 -05:00
Tyler Goodlet 890f932400 Use through lot digits, drop YSticky 2021-02-08 07:00:51 -05:00
Tyler Goodlet bf66eb0b3d Support lot tick size (mostly for crypto) 2021-02-08 06:42:59 -05:00
Tyler Goodlet d7f806c57b Add arrowheads to labels
For labels that want it add nice arrow paths that point just over the
respective axis. Couple label text offset from the axis line based on
parent 'tickTextOffset' setting. Drop `YSticky` it was not enough
meat to bother with.
2021-02-08 06:40:11 -05:00
Tyler Goodlet c3fa31e731 Convert symbol type to use pydantic 2021-02-06 14:38:25 -05:00
Tyler Goodlet 0c184b1b41 Port ib to new provide new tick size fields in symbol info 2021-02-06 14:37:24 -05:00
Tyler Goodlet 69df73afc3 Deliver symbol info from kraken; start using pydantic 2021-02-06 14:23:27 -05:00
Tyler Goodlet a8c4829cb6 Start using `tick_size` throughout charting
The min tick size is the smallest step an instrument can move in value
(think the number of decimals places of precision the value can have).

We start leveraging this in a few places:
- make our internal "symbol" type expose it as part of it's api
  so that it can be passed around by UI components
- in y-axis view box scaling, use it to keep the bid/ask spread (L1 UI)
  always on screen even in the case where the spread has moved further
  out of view then the last clearing price
- allows the EMS to determine dark order live order submission offsets
2021-02-06 11:35:12 -05:00
Tyler Goodlet 03541bd368 Drop unneeded .hide(); add more comments 2021-01-26 22:16:18 -05:00
Tyler Goodlet cfc36e7928 Snap y-cursor-label to min tick 2021-01-26 22:15:45 -05:00
Tyler Goodlet 708086cbcb Convert contractsto dicts on errors 2021-01-26 13:34:49 -05:00
Tyler Goodlet 5a0612e6a8 Factor some line and label steps 2021-01-26 13:34:29 -05:00
Tyler Goodlet 8501a9be4f Lol actually fix screen wakeup lookup.. 2021-01-26 12:26:43 -05:00
Tyler Goodlet a232e8bc39 Display order size on order lines in order mode 2021-01-26 11:36:44 -05:00
Tyler Goodlet 25ec5faaef Drop removed show_label kwarg 2021-01-26 11:28:24 -05:00
Tyler Goodlet b9d9dbfc4a Support size fields on order lines; avoid overlap with L1 lines 2021-01-26 11:27:50 -05:00
Tyler Goodlet 990c3a1eac Try out 3 ticks away as limit submission 2021-01-26 11:26:30 -05:00
Tyler Goodlet cc5af7319f Slightly lighter sell red, try to fix screen stuff... 2021-01-22 23:02:23 -05:00
Tyler Goodlet 18fafb501d Use dashed lines for dark orders 2021-01-22 23:01:12 -05:00
Tyler Goodlet 4b2161a37b Use 2 min-ticks offset for dark orders 2021-01-22 23:00:01 -05:00
Tyler Goodlet f072e2551b Snap y-axis crosshair to min tick(s) 2021-01-22 22:59:00 -05:00
Tyler Goodlet 50d2d8517b Add support for dotted style level lines 2021-01-22 22:57:42 -05:00
Tyler Goodlet 92efb8fd8e Expect new init message in feed from brokers 2021-01-22 22:56:42 -05:00
Tyler Goodlet b4a4f12aa4 Send init message with kraken 2021-01-22 22:55:49 -05:00
Tyler Goodlet 10e47e349c Include symbol deats in feed init message from ib
Async spawn a deats getter task whenever we load a symbol data feed.
Pass these symbol details in the first message delivered by the feed at
open. Move stream loop into a new func.
2021-01-22 17:11:53 -05:00
Tyler Goodlet 5327d7be5e Add screen acquire timeout loop 2021-01-22 16:46:39 -05:00