Skip to content

Dev howiemen - #3

Merged
HowieMen merged 8 commits into
mainfrom
dev-howiemen
Aug 25, 2026
Merged

Dev howiemen#3
HowieMen merged 8 commits into
mainfrom
dev-howiemen

Conversation

@HowieMen

Copy link
Copy Markdown
Contributor

No description provided.

…findings

Add a v0.1 real-data review note to the README flagging that unit tests
and single-symbol smoke tests pass, but a review of the full
`~/.hqdata/tushare` snapshot exposed multiple serious defects only
visible on real data: `history()` crashes on suspended/mid-listing stocks,
multi-symbol performance is unusable (>10 min for 5 stocks × 139 days),
first-day PnL is invisible in max drawdown and volatility, same-day sell
proceeds cannot fund buys, net asset value silently under-records
dividends across ex-dividend dates, and the `hqbacktest` console script
fails to import user strategy modules. Clarify that v0.1 is only suitable
for single-symbol, non-suspended, non-ex-dividend demo scenarios.

Document the task 14 fixes in the capability matrix and planned scope:
`MarketDataPortal.get_universe` defaults to filtering `.BJ` (Beijing
Exchange) stocks with an `include_bj=True` opt-in, the first-day
`visible_through="00000000"` sentinel no longer raises, `get_bars`
allows day-by-day gaps, suspended positions are valued at the most
recent close from the prior 20 trading days with a `DATA_WARNING` event
written, missing daily snapshot files raise `SnapshotFileMissingError`,
and document that `Bar.volume` is denominated in lots (1 lot = 100
shares) consistent with the Tushare `hqdata` adapter.
… layers

Optimize `DataView.current_price` to a single `get_bars` slice (was N day-by-day round-trips) while preserving the 20-trading-day lookback bound, add per-day file + per-symbol cumulative caching in `HqDataCsvPortal`, and document Task 15 benchmarks and memory characteristics in README.
- Add §3.4 to mvp-contract capturing SELL-before-BUY ordering,
  rolling cash checks, lot rounding rules (BUY only), T+1 rejection,
  fee-free realized_pnl, ROUND_HALF_EVEN quantization, Fill.BUY
  stamp_tax invariant, target_quantity_for_value(0), and CLI float
  rejection
- Surface the matching/ledger contract in README under task 16
- Tighten CLI config to reject float for initial_cash, aligning with
  BacktestConfig precision contract (rule 5)
- Update changelog with 2026-08-24 task 16 entry
- README: document first-day P&L into curve, volatility sample-size guard, Decimal power bridge via `Decimal(str(float(...)))`, and `positions.sellable_quantity` post-settlement semantics
- mvp-contract: register §3.5 with table entries for daily_return/drawdown base, None-return for insufficient volatility samples, Decimal quantization, and sellable_quantity post-settle timing
- changelog: 2026-08-24 entry for task 17 metrics baseline
- README 新增「因子诊断与分红偏差显性化」章节,明示 adjustment_policy=none 下跨除权日净值系统性低估
- mvp-contract.md 新增 §3.7 固化诊断阈值(0.1%)、写入位置、零账本影响、CLI 警告语义
- Order 字段补 `fill_ids: tuple[str, ...]` 描述;变更日志登记任务 19
Document the v0.1.1 patch release in CHANGELOG.md, covering all backward-compatible hardening changes from the v0.1 real-data review: data layer hardening and performance improvements, refined match/ledger semantics, equity curve and metrics baseline fixes, strategy isolation safeguards, holdings-period factor diagnostics, CLI first-mile enhancements, and the new integration test infrastructure.
@HowieMen
HowieMen merged commit 4ed932c into main Aug 25, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant