fix(trader): make live sessions complete, final-close based and executable

- Process every completed session since the last recorded one, so monitor
  downtime and late data are caught up; today's bar only counts after the
  exchange closes. The monitor's evening phase always goes through auto and
  catches up at startup.
- Tickers without a real closing print are valued at the last price but not
  traded; held tickers missing from the panel keep their last recorded price
  instead of being valued at zero.
- Use registry parameters (live momentum strategies ran top_n=len//10=49
  instead of the backtested 20).
- A-share orders use 100-share board lots; per-market default capital
  (US $10k, CN ¥70k); HK tickers are converted to USD (HKD=X, peg fallback)
  and exempt from the US per-share fee.
- ETF strategies only run in the US book; buy_and_hold is excluded from live
  because its ~$20 slices never reach the minimum order size.
- CN benchmark switches to 510300.SS (Yahoo's 000300.SS is truncated).
- New 'replay' command rebuilds live state files from each start date.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-25 01:16:14 +08:00
parent 838749d8b2
commit 11f4dd95dd
2 changed files with 384 additions and 158 deletions

View File

@@ -129,7 +129,9 @@ UNIVERSES = {
},
"cn": {
"fetch": get_csi300,
"benchmark": "000300.SS",
"benchmark_label": "CSI 300 (Benchmark)",
# Yahoo's 000300.SS index series is truncated (and at times a single
# row); the CSI 300 ETF has a continuous history back to 2012.
"benchmark": "510300.SS",
"benchmark_label": "CSI 300 ETF 510300 (Benchmark)",
},
}