Skip to content

fix(backtest): 板块筛选包含创业板 302 与科创板 689 号段 - #488

Merged
shy3130 merged 1 commit into
shy3130:mainfrom
kevin9327:fix/matrix-board-filter-302-689
Oct 18, 2026
Merged

shy3130 merged 1 commit into
shy3130:mainfrom
kevin9327:fix/matrix-board-filter-302-689

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

问题

回测矩阵按板块筛选股票池时 (app/backtest/matrix.py 的 _symbol_in_boards):

  • 「创业板」只匹配 300/301, 创业板 302 号段 (如 302132.SZ) 不在其中;
  • 「科创板」只匹配 688, 科创板 689 号段 (如 689009.SH) 不在其中。

这两类代码也不匹配「深主板」(00) 或「沪主板」(60), 所以无论选哪个板块都会被静默排除出股票池。

修改

创业板前缀加上 302, 科创板改为 688/689, 与 price_limits.py、market_overview_builder.py 的板块口径一致。

测试

新增 tests/test_matrix_board_filter.py:

  • 修复前: 2 failed
  • 修复后: 2 passed; ruff 通过

AI assistance: this change was prepared with an AI coding assistant and reviewed and tested by me.

@shy3130
shy3130 force-pushed the fix/matrix-board-filter-302-689 branch from 4cc298b to 18dae26 Compare October 18, 2026 06:39
@shy3130
shy3130 merged commit 7ee42af into shy3130:main Oct 18, 2026
shy3130 pushed a commit that referenced this pull request Oct 18, 2026
#485 修了创业板 302 但科创板分支仍只有 688; 689 (CDR 号段, 如
689009.SH) 在 price_limits/matrix/overview/paper 均已覆盖, 引擎
选股漏配 — 选「科创板」时 689 标的被静默排除。与 #488 口径对齐,
附板块过滤号段回归测试。
@shy3130

shy3130 commented Oct 18, 2026

Copy link
Copy Markdown
Owner

感谢提交,已合并进 main 🎉

回测板块筛选的 302/689 缺口独立于 #485,测试直击业务断言,309 个 backtest 测试通过。

一处处理说明:diff 里夹带的 backend/uv.lock(revision 3→5 的 lock 格式升级,来自本地新版 uv)与本 PR 无关,已剔除后再合并,避免污染依赖锁定文件。后续提 PR 时留意一下排除它就更好了。

flyme8899 added a commit to flyme8899/tick-stock-panel that referenced this pull request Oct 18, 2026
) (#158)

同步上游 shy3130#485/shy3130#486/shy3130#488:创业板纳入 302,科创板纳入 689,涨跌停、板块筛选与前端标签共用同一号段口径。

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: flyme8899 <[email protected]>
yanbaobao010913 pushed a commit to yanbaobao010913/tick-stock-panel that referenced this pull request Oct 20, 2026
yanbaobao010913 pushed a commit to yanbaobao010913/tick-stock-panel that referenced this pull request Oct 20, 2026
shy3130#485 修了创业板 302 但科创板分支仍只有 688; 689 (CDR 号段, 如
689009.SH) 在 price_limits/matrix/overview/paper 均已覆盖, 引擎
选股漏配 — 选「科创板」时 689 标的被静默排除。与 shy3130#488 口径对齐,
附板块过滤号段回归测试。

(cherry picked from commit f5ca4e1)
Dancetofigureoutyourshadow pushed a commit to Dancetofigureoutyourshadow/tick-stock-panel that referenced this pull request Oct 20, 2026
Dancetofigureoutyourshadow pushed a commit to Dancetofigureoutyourshadow/tick-stock-panel that referenced this pull request Oct 20, 2026
shy3130#485 修了创业板 302 但科创板分支仍只有 688; 689 (CDR 号段, 如
689009.SH) 在 price_limits/matrix/overview/paper 均已覆盖, 引擎
选股漏配 — 选「科创板」时 689 标的被静默排除。与 shy3130#488 口径对齐,
附板块过滤号段回归测试。

(cherry picked from commit f5ca4e1)
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.

2 participants