feat: phase 1 — data downloader, backtrader runner, SMA strategy

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Yuxuan Yan
2026-06-07 09:21:16 +08:00
parent 338c912029
commit fd86190e9a
19 changed files with 456 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
from dataclasses import dataclass, field
from datetime import date
@dataclass
class BacktestConfig:
symbols: list[str] = field(default_factory=lambda: ["sh600000"])
start_date: str = "2023-01-01"
end_date: str = "2024-12-31"
initial_cash: float = 1_000_000.0
commission: float = 0.0003 # 0.03% for Chinese A-shares
stamp_duty: float = 0.001 # 0.1% stamp duty on sells only (handled in strategy)
adjust: str = "qfq"