Kill Switch Runbook
Use this runbook when the trading stack must stop creating risk immediately.
When to Use
- drawdown or loss thresholds are escalating toward
NO_NEWorFLATTEN - broker API degradation makes order state unreliable
- data corruption or stale upstream inputs make signals untrustworthy
- reconciliation finds unknown or mismatched positions
- operator judgement says continuing to run is unsafe
Current System Reality
- The kill-switch logic lives inside
qgtm_risk.manager.RiskManager - The daemon escalates tiers from
WARNtoTHROTTLEtoNO_NEWtoFLATTEN - There is no dedicated public HTTP kill-switch endpoint in the current paper-first production path
- There is no standalone
python -m qgtm_live.kill_switchcommand in the repo
Immediate Operator Actions
1. Stop the daemon
2. Confirm the control plane is no longer advancing
3. Cancel or flatten at the broker if exposure exists
- Use the Alpaca dashboard or broker tooling to cancel open orders
- Flatten any unwanted open positions directly at the broker if necessary
4. Keep live trading disabled before restart
Ensure the runtime configuration still keeps live trading gated off:
5. Preserve evidence
- save daemon and API logs
- note the trigger reason
- capture positions, orders, and any reconciliation mismatch
Automated Kill-Switch Behavior
The daemon can escalate automatically based on:
- daily loss limits
- drawdown state
- heartbeat/watchdog conditions
- order or execution anomalies surfaced by the runtime
See qgtm_risk.manager and qgtm_live.daemon for the current code path.
Recovery
- identify the root cause
- verify orders and positions are reconciled
- confirm market data and broker state are clean
- review whether the system should restart in paper-only mode
- document the incident before returning the daemon to service