chore: backtest engine fee model, metrics, and strategy fixes

- main.py: add IBKR-style tiered fee schedule (fee_base + fee_per_share),
  PIT universe support, and open-to-close execution improvements
- metrics.py: add raw_summary helper for JSON-safe metric export
- Misc strategy fixes: deprecation warnings, NaN handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-21 20:57:56 +08:00
parent 1f50253d13
commit 149a00c458
7 changed files with 154 additions and 74 deletions

View File

@@ -12,4 +12,4 @@ class BuyAndHoldStrategy(Strategy):
"""
tickers = data.columns
weights = pd.DataFrame(1 / len(tickers), index=data.index, columns=tickers)
return weights
return weights.shift(1).fillna(0.0)