---
name: quant_trading_desk_ops
description: Runs a personal quant trading desk end to end: strategy-lab research protocol, paper-trade ops, live execution gates, position sizing, risk limits, monitoring, and post-trade review. Use when an agent needs to design, backtest, paper trade, size, gate, monitor, or review a trading strategy with real risk controls. Not for broker API plumbing; it covers the methodology around the broker.
---

# Quant Trading Desk Ops

## Purpose

Turn a personal trading operation from loose discretion into a repeatable desk: a strategy lab that filters ideas before they touch money, a paper-trade stage with teeth, a live execution protocol where risk is computed before every order, and a review loop that measures execution quality instead of just P&L.

## Workflow

### 1. Strategy lab
Follow `references/strategy-lab.md` for the research pipeline: idea -> bias-checked backtest -> walk-forward validation -> cost-modeled simulation. No idea graduates without the bias checklist signed off (lookahead, survivorship, overfitting, costs, data snooping). A strategy that cannot state its edge in one plain sentence does not graduate.

### 2. Paper-trade ops
Run every graduate on paper for a fixed soak window (references give a starting calibration, adapt to the instrument). Log every fill to `trades.csv` with `desk.py journal`. Paper counts only if you run the same risk gates as live; a paper run without the risk config is theater.

### 3. Live execution protocol
Before every order, run the pre-trade gate:
```
python3 bin/desk.py check --config limits.yaml --journal trades.csv \
  --equity 25000 --risk-dollar 250 --symbol AAPL
```
The gate fails closed: daily loss limit hit, portfolio heat exceeded, position count maxed, stale config, missing stop, or sizing outside the per-trade cap all mean NO TRADE. Never bypass the gate to keep a session moving. The kill switch (a single command or button that cancels all open orders and blocks new ones) must exist before the first live order. Reconcile the desk against the broker every session start; the broker is the book of record, the local state is a cache.

### 4. Daily ops rhythm
- **Pre-market:** scan macro events, earnings, and news that could spike volatility; run the setup scan; if no setup meets the written rules, no trade. No trade is a valid day.
- **During session:** size every position with `desk.py size`; place stop at entry time, never after. Log fills immediately.
- **Post-market:** journal entries with execution notes: slippage, rule adherence, what the setup did. Score the day on process, not dollars.

### 5. Post-trade review
Weekly: `python3 bin/desk.py weekly --journal trades.csv`. Review win rate, profit factor, average win vs average loss, slippage drift, and rule-adherence rate. A strategy whose paper edge evaporates in live review goes back to the lab or gets retired. See `references/trade-review.md` for the review questions.

## Output Contract

- `limits.yaml`: the desk's full risk-limits config (per-trade, daily, heat, drawdown, positions, kill-switch procedure). Written once, changed only by an explicit operator decision, never mid-session.
- `trades.csv`: the trade journal. Every fill logged same session, no exceptions.
- `bin/desk.py` outputs: machine-checkable size numbers, PASS/FAIL gate verdicts with reasons, and weekly stats.
- Weekly review: short written verdict per strategy (keep / send back to lab / retire) with numbers attached.

## Operating Rules

1. Risk is computed before the order, not after. A position without a pre-computed stop distance has no defined size.
2. One percent per trade is the default; half that while learning, more than two percent never. Kelly stays at half or quarter strength and only with a real sample.
3. Fail closed on everything: missing data, broker timeout, gate script error, stale feed. An open question means no order.
4. Paper trading must use the same risk config as live. Different configs make the comparison worthless.
5. Costs are real: model commissions, spread, and slippage in the lab, and measure realized slippage in the journal.
6. One plain sentence states the edge. If you need a paragraph, there is no edge.
7. Most trading days should end with zero regrets about process, whatever the P&L says.
