12.Hotkeys & paper trading
Define hotkey actions (write a journal note, tag the current trade, paper-buy/sell at market) and bind them to single-key combos. Paper accounts run the same FIFO roll-up as real accounts — separate paper tier so they don't pollute your live equity curve.
The Hotkeys editor
GET/POST /api/hotkeys. Hotkeys are user-defined actions bound to a single key or chord. Each hotkey has:
- Key — letter / digit / function key + modifiers (Cmd / Opt / Ctrl / Shift).
- Action — one of: paper-buy, paper-sell, paper-close-all, tag-current-trade, journal-current-trade, refresh-view, open-research, open-chart, run-custom.
- Scope — global, or limited to certain views (Charts, Scanner, Trades, Live Positions).
- Parameters — for paper-buy: quantity / dollar amount / position-size formula; for tag: which tag; for run-custom: an HTTP request to dispatch.
- Confirm — pop a non-blocking confirm before executing (defaults on for paper-buy / paper-sell, off for tag / journal).
Hotkeys conflict-check against the 48-key global shortcut registry on save (step 18) — you can't bind R to a custom action without first deciding to override the existing view-scoped Refresh binding.
Paper accounts
Paper accounts (POST /api/paper/accounts) are isolated from live data — their executions land in the same executions table but tagged account.tier = 'paper', and reports / dashboards default to tier = 'live' so the paper book doesn't pollute your equity curve.
- Create — name, starting cash, asset classes enabled.
- Positions —
GET /api/paper/accounts/{id}/positionsmirrors the Live Positions tile against the paper executions. - Orders —
POST /api/paper/accounts/{id}/orders. Market / limit / stop / stop-limit. Market orders fill at the next tick (live) or next bar's open (replay). - Reset —
POST /api/paper/accounts/{id}/reset. Wipes all executions on the paper account, restores starting cash. Useful for clean walk-forward retests.
Hotkey → paper trade flow
- You're watching the Scanner panel. A symbol catches your eye.
- Right-click → Charts (or hit
C, the view-scoped binding) → land on the symbol's chart. - Press
B(your hotkey for paper-buy with $500 risk, position-sized by Kelly). The non-blocking confirm appears. - Enter to confirm; the paper order is placed at market and fills at the next tick.
- An execution lands in
executions; the rollup fires; a new open trade appears in your paper Trades view; the journal slot is created with the appropriate template (step 04). - Press
J(your hotkey for journal-current-trade) → editor opens with the template seeded, you type your thesis, save. - Later: press
S(paper-sell all current paper positions) to close. Exit execution lands, trade rolls up to closed, R-multiple calculated, journal entry tagged completed.
End-to-end, the workflow is keyboard-only. The mouse is for chart drawings.
Paper trading isn't simulation
Paper orders fill against the live tick stream — slippage / partial fills aren't modeled, but timing is real. A paper buy on a thin name still respects the bid/ask at the time of fill; you can't paper-fill at the midpoint of a 10-cent spread.
- Market orders fill at the live ask (buy) or bid (sell) at the moment the order is submitted.
- Limit orders rest until the live last touches the limit; fill at the limit price.
- Stop orders convert to market on stop-trigger.
- No queue-position modeling. If your limit is at the top of the book and the last touches, you fill — even though in reality the order ahead of you might fill first.
Replay mode (Charts → Replay) runs the same paper-order machinery against historical bars at user-controlled playback speed — useful for practicing without waiting for a real session.
Position-size calculator
The position-size tile (Trading → Position Size) and the same calculator inline in the New Trade form take account equity, planned stop distance, account risk %, and optional correlation context, and return:
- Shares / contracts for the requested risk.
- Dollar at risk per share / contract.
- Total dollar at risk (validates against the account risk % cap).
- Kelly fraction — full Kelly + capped fractional-Kelly suggestion based on the symbol's historical R-distribution.
- Correlation adjustment — if you have open positions correlated with the symbol, the suggested size shrinks proportionally so total portfolio risk stays within the cap.
Accepting the recommendation writes the resulting size into the order form and sets planned_risk on the trade (drives R-multiple in reports).