You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
I Luk Kim 99ad043f14 Paper trader Phase 1.A.1: poll actual fill price on exits, kill silent drop
Previously close_position(..., fill_price=X) was silently swallowed by
**kwargs while the DB wrote the simulated exit_price — broker and ledger
drifted on every exit.

- AlpacaBroker.close_position drops the **kwargs sink; docstring documents
  that callers must poll get_order(order.id) for the actual filled_avg_price
- _poll_exit_fill(order_id, symbol, timeout=30s) added; 1s interval, returns
  actual Alpaca fill price, logs timeout/terminal status
- 3 exit sites now poll and write the actual fill + re-derive net_pnl
  with direction-aware sign (short-safe for future short configs):
    run_daily main exit path (simulate_exit)
    _monitor_close (intraday stop/target hits)
    _process_exits (scheduled & forced exits incl. partial T1)
- WARN-level "paper_engine_exit_fill_drift" when actual vs simulated
  diverges >0.5% so drift is visible in logs even when non-pathological

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
..
__init__.py Add paper trading system: broker integration, state management, reporter 5 months ago
alpaca_broker.py Paper trader Phase 1.A.1: poll actual fill price on exits, kill silent drop 4 months ago
auto.py Paper trader Phase 1 fixes: multi-session isolation, pipeline halt, snapshot refresh unblock 4 months ago
backtest_sim.py Clean up superseded configs and commit accumulated R&D infrastructure 4 months ago
cli.py Prune unused sleeve presets and trim web preset lists 4 months ago
engine.py Paper trader Phase 1.A.1: poll actual fill price on exits, kill silent drop 4 months ago
event_detector.py Extend lookback entry to paper trader and mock broker 4 months ago
mock_broker.py Add paper trading system: broker integration, state management, reporter 5 months ago
models.py Add paper trader improvements, web GUI updates, and experiment registry cleanup 4 months ago
reporter.py Remove overlay backtesting and scoring 5 months ago
state.py Add paper trader improvements, web GUI updates, and experiment registry cleanup 4 months ago