Commit Graph

24 Commits

Author SHA1 Message Date
18174a9e11 Compute residual vol for square regressions 2026-04-07 16:57:58 +08:00
3d934b3316 Handle square factor regressions without inference 2026-04-07 16:53:16 +08:00
0876c0b6af Guard factor regressions against unidentified models 2026-04-07 16:48:23 +08:00
f2e14ec200 Add factor attribution regression engine 2026-04-07 16:40:24 +08:00
507565c556 Tighten benchmark mutation leakage test 2026-04-07 16:34:35 +08:00
26937f035e Split proxy leakage tests 2026-04-07 16:31:51 +08:00
7afc60dfcb Strengthen proxy factor builder tests 2026-04-07 16:28:00 +08:00
7e44ece569 Add factor builder leakage tests 2026-04-07 16:21:05 +08:00
7e8d24c1e9 Add local attribution factor builders 2026-04-07 16:16:59 +08:00
2382364a46 Handle HTTP protocol errors in factor download 2026-04-07 16:12:00 +08:00
71912b8358 Wrap additional network errors in factor download 2026-04-07 16:06:54 +08:00
7f0c5de574 Use explicit download errors for factor loader fallback 2026-04-07 16:01:51 +08:00
c46727b1ca Handle OSError download fallback for factor loader 2026-04-07 15:57:16 +08:00
0e94688066 Narrow factor loader format fallback handling 2026-04-07 15:51:57 +08:00
9e6da727a3 Implement Ken French factor download and cache fallback 2026-04-07 15:44:46 +08:00
e70922d9af Harden factor loader zip parsing and fallback 2026-04-07 15:38:49 +08:00
feb1864a4d Add factor loader and cache scaffolding 2026-04-07 15:27:44 +08:00
80493cb6af Add factor attribution design spec 2026-04-07 15:01:57 +08:00
14ec64c1da Single-process monitor for US + CN markets
- `trader.py monitor` now handles all markets in one process
  (US 9:45/16:35 ET, CN 9:45/15:35 CST) with unified UTC event loop
- Events from different markets/timezones are merged; sleeps until
  the globally next event across all markets
- Overlapping events (e.g. US evening + CN morning) fire together
- `trader.py compare` defaults to US, use --market cn for A-shares
- One tmux session handles everything: just `uv run python trader.py monitor`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 00:16:46 +08:00
4aa17c7e98 Zero-config monitor and compare
- `trader.py monitor` — runs ALL 9 strategies by default, $10k capital,
  $2 fee, integer shares. Just start and forget.
- `trader.py compare` — auto-discovers all state files in data/, no
  --strategy needed. Ranks by return with equity curves.
- Monitor defaults: --capital 10000, --fixed-fee 2.0, --integer-shares

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 00:10:00 +08:00
7f618b9c31 Multi-strategy monitor and compare command
- Monitor accepts multiple --strategy args, runs all at each phase
- Each strategy maintains its own independent state file
- Add 'compare' subcommand: side-by-side ranking table + equity curves
- Error in one strategy doesn't block others (isolated try/catch)

Usage:
  trader.py monitor --strategy recovery_mom_top10 momentum dual_momentum
  trader.py compare --strategy sim_recovery_mom_top10 sim_momentum

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 00:04:45 +08:00
942164a38f Two-phase monitor, integer shares, and daily log
- Monitor now runs morning (9:45 → signals) and evening (4:35 → execute)
  instead of single daily run; falls back to auto if morning missed
- Add --integer-shares flag for whole-share-only trading (no fractional)
- Add daily_log to state: each day records holdings, cash, and operations
- Add 'log' subcommand to view daily snapshots with date range filter
- record_daily_snapshot() called from both simulate and auto commands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 23:57:03 +08:00
4709271504 auto mode for continuous running 2026-04-05 00:50:26 +08:00
42218741d4 Initial commit: quant backtesting framework with daily trading simulator
Backtesting engine supporting 11 strategies across US (S&P 500) and CN (CSI 300)
markets with open-to-close execution, proportional + fixed per-trade fees.

Daily trader (trader.py) with auto/morning/evening/simulate/status commands
and cron-friendly `auto` mode for unattended daily runs on a server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 00:41:19 +08:00