Explicit approval conditions
Checks cover data freshness, the local emergency stop, disk capacity and unresolved orders. A running process alone does not establish trading readiness.
Personal project · Trading systems backend
An execution core that makes the conditions for sending and stopping orders explicit. Risk checks, an order ledger, protective orders and recovery share a defined workflow, with offline research kept separate from execution.
Content reviewed:
Duplicate requests and interrupted exchange responses can leave order outcomes uncertain. The system records approval conditions and execution state together so stale market or account data cannot silently authorize a new entry, and an uncertain order is not immediately resent.
Each stage records its state, from order intent through dispatch and reconciliation. General new-entry approval and dispatch are currently limited to the offline simulator.
Check freshness of market data, user streams, exchange metadata and reconciliation results.
Evaluate order limits, available margin, open-order exposure and active reservations.
Persist approval and pending execution, then recheck approval expiry and policy changes before dispatch.
Keep uncertain responses as UNKNOWN and reconcile them through exchange queries and fill events.
Checks cover data freshness, the local emergency stop, disk capacity and unresolved orders. A running process alone does not establish trading readiness.
Repeated requests return the existing submission. Approved entry and protective-order plans are stored together, and the first partial fill activates the protective-order outbox.
REST collection and private WebSocket events are coordinated per account. Supporting tools handle data retention, database migrations, database roles and an independent emergency stop.
Local CSV research checks data timing, cost and latency sensitivity, chronological splits and holdout usage. Research output does not automatically authorize new orders.
src/auto_trader/readiness.py · risk.py — Readiness and order risk checkssrc/auto_trader/service.py · database.py — Duplicate requests, ledger, dispatch and reconciliationsrc/auto_trader/observation.py · research.py — Observation collection and offline research