2026-04-08 - Daily Log¶
Morning¶
- 09:00 CT cron fired: HK market data update (ct-daily-data-hk)
Afternoon - CN Backtest Architecture¶
Python Environment Cleanup¶
- Deleted
clawtrading311-legacyenvironment - Now only
clawtrading314(Python 3.14) remains - Updated TOOLS.md
CN Backtest Fixes¶
- TuShare API caching: Added
_CN_CONSTITUENTS_CACHEandpreload_cn_constituents()to avoid rate limiting - Month-end dates: Changed from
freq="MS"tofreq="ME"for index constituent queries - Rebalance period: Changed from 20 to 21 days (align with US/HK)
- Index support: Added创业板指 (399006.SZ) to
_CN_INDEX_MAP
Parallel Implementation¶
- Created
backtest/parallel_utils.pyfor ProcessPoolExecutor compatibility - Modified
cli.pyto support parallel strategy computation --parallelnow defaults to True
CN 2-Year Backtest Results¶
- Strategy:
ml_only_alpha500_cn - Period: 2024-04-03 → 2026-04-03
- Total Return: +227.79%
- Sharpe: 2.18
- MDD: -16.19%
Fold-Level Parallelism Results¶
42.8x Speedup! 🚀
| Mode | Time | Rebalances |
|---|---|---|
| Standard (compute_daily_schedule) | 69.47s | 18 |
| Fold-Parallel (compute_schedule_parallel) | 1.62s | 22 |
Implementation:
- compute_schedule_parallel() in backtest/scheduler.py
- Two-phase architecture:
- Phase 1: Pre-compute shared data (cov, mu_mean, ma60) - parallel
- Phase 2: Optimize each fold - sequential (w_prev dependency)
- CLI: --fold-parallel flag added
- Auto-detection: Only enabled for features=['mean'] strategies
Limitations: - Fold-parallel uses fixed 20-day rebalance (simpler) - Standard path has dynamic monthly refresh + circuit breaker - ML strategies automatically fall back to standard path
Open Questions¶
- None remaining - parallelization complete!