Live trading enable

Promotes the engine from dry_run=true to dry_run=false at runtime via the runtime_settings table. All four gates must be green before the Promote button enables.

  • IBKR gateway connected
    no recent BROKER_HEARTBEAT in audit_log
  • Kill switch disengaged
    no kill switch events on record
  • Daily loss limit not breached
    today's realized: $0.00 (limit −$50)
  • Backtest passed (BACKTEST_PASS audit row in last 24h)
    Run a backtest with positive expectancy on /backtest in the last 24h to satisfy this gate.
Current engine state: unknown

How this works

  1. Promote writes {value: false} to runtime_settings.dry_run_override and a LIVE_ENABLE row to audit_log.
  2. The engine reads that row at the start of every heartbeat (~60 s cadence), overlays it on cfg.broker.dry_run, and emitsDRY_RUN_FLIPPED the first cycle the value changes.
  3. Subsequent place_order() calls hit IBKR for real. The PaperAccountGuard still blocks any non-paper account_id, so a misconfigured live account cannot accidentally place orders.