Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordermode pps #205

Merged
merged 178 commits into from
Sep 6, 2021
Merged

Ordermode pps #205

merged 178 commits into from
Sep 6, 2021

Conversation

goodboy
Copy link
Contributor

@goodboy goodboy commented Jul 11, 2021

Working draft of highly game-like position and order tracking for order mode.

Target feature list:

  • pp off screen indicators on order mode activation
  • the same for (groups of) order(s) per symbol -> this i'd like feedback on first.
  • paper engine positions support -> actually came in Paper pp tracking #218
    • first in just memory and from scratch each app session -> NB: currently it's only working for the first loaded symbol (paper only) due to the way the paperboi engine is loaded with it's feeds; we need a fix for this.
    • eventually stored in positions.toml? Probably want to coordinate with Phil MacKraken  #214.
  • $positioning for default orders
  • % pnl on pp indicator label
  • initial order mode info menu with selectable position style/sizing options

@goodboy goodboy added data-layer real-time and historical data processing and storage UI viz testing graphics (charting related) geometry chops labels Jul 11, 2021
@goodboy goodboy self-assigned this Jul 11, 2021
@goodboy goodboy force-pushed the ordermode_pps branch 7 times, most recently from 99a9500 to bae23a6 Compare September 2, 2021 16:58
@goodboy goodboy mentioned this pull request Sep 5, 2021
@goodboy goodboy changed the base branch from master to paper_pp_tracking September 5, 2021 18:52
@@ -1295,10 +1297,14 @@ def pack_position(pos: Position) -> dict[str, Any]:
else:
symbol = con.symbol

symkey = '.'.join([
symbol.lower(),
(con.primaryExchange or con.exchange).lower(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug where on pp loading from the broker, a sub-string of the actual intended instrument symbol would match showing a pp indicator for the wrong chart. explicitly truncating and appending the exchange solves this.


else:
await stream.send({sym: quote})
with trio.move_on_after(0.2) as cs:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively a backpressure detector and should basically never get entered unless there's an issue on the consumer side (which hopefully all these are resolved now).

Not sure if we should put this onto master though with the .breakpoint() but I haven't seen it happen yet in practice.


class LinkedSplits(QtWidgets.QWidget):
class ChartnPane(QFrame):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composite to make the order pane stuff work alongside the linked split charts.

Base automatically changed from paper_pp_tracking to master September 6, 2021 13:27
Acts as a fix for lodpi and better sizing logic for the pp status bar.
Drop all the redundant passing of the form to its child layouts during
instantiating (since they're all added as layouts to the tree). Comment
out the feed status label for now since it's not hooked up to the
backend and we'll get it going in a new PR.

Down the road we probably want to do all the pp pane component-widget
sizing *after* the `pyqtgraph` chart is up; it's going to take some
reworking of the charting api tho.
We weren't updating the LHS size labels on creation and we now use the
lot size digits to do so. Change `PositionTracker.update()` to
`.update_from_pp_msg()`.
@goodboy goodboy force-pushed the ordermode_pps branch 5 times, most recently from 30d0317 to 21019e6 Compare September 6, 2021 18:07
@goodboy
Copy link
Contributor Author

goodboy commented Sep 6, 2021

Follow up issue list inspired or drafted in this patch set:

@goodboy goodboy merged commit 73b555a into master Sep 6, 2021
@goodboy goodboy deleted the ordermode_pps branch September 6, 2021 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-layer real-time and historical data processing and storage graphics (charting related) geometry chops testing UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant