Skip to content

fix(price-limits): 创业板 302 号段按 ±20% 与创业板规则处理 - #485

Merged
shy3130 merged 1 commit into
shy3130:mainfrom
kevin9327:fix-chinext-302
Oct 18, 2026
Merged

shy3130 merged 1 commit into
shy3130:mainfrom
kevin9327:fix-chinext-302

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

问题

深交所创业板已启用 302 号段:中航电测(300114)完成重组后,自 2025-02-17 起证券代码变更为 302132.SZ(中航成飞),仍是创业板股票,涨跌幅 ±20%。

但项目里判断板块的前缀只认 300/301,302 开头的代码一律落到「主板 10%」分支:

  • price_limits.board_limit_pct / price_limit_pct / polars_price_limit_pct:涨跌停价按 ±10% 计算,指标管线和回测里的涨停/跌停信号、可成交判断全部算错(302132 涨 15% 会被当成"超过涨停");
  • price_limits.no_limit_window_days:302 号段新股的上市初期无涨跌幅窗口按主板注册制日期判定;
  • strategy/paper.py::limit_pct:模拟盘的涨跌停价按 10% 卡单;
  • strategy/engine.py 选股「创业板」板块过滤漏掉 302;
  • api/overview.py / services/market_overview_builder.py 的 _board 把它归为「深主板」;
  • fuyao / tdxquant 数据源的自检容差 _price_limit 同样按 10%。

修改

上述各处的创业板前缀统一加上 302,不改其它逻辑。

测试

  • tests/test_price_limits.py::test_chinext_302_codes_use_growth_board_rules:price_limit_pct("302132.SZ", ...) 与 polars_price_limit_pct 应为 0.20;
  • tests/test_price_limits.py::test_chinext_302_no_limit_window_follows_gem_registration_date:2021 年上市的 302 新股应有 5 日无涨跌幅窗口;
  • tests/test_paper_trading.py::test_limit_pct_chinext_302:模拟盘 limit_pct("302132.SZ") 应为 0.20。

修改前三个用例均失败(得到 0.10 / 0),修改后通过。tests/test_price_limits.py 与 tests/test_paper_trading.py 全部 55 个用例通过;ruff 对改动文件的告警数与修改前一致(均为既有告警)。


AI 辅助说明:本 PR 在 AI 编码助手协助下完成,改动与测试均已本人审阅并在本地运行。

@shy3130
shy3130 merged commit 7f02c04 into shy3130:main Oct 18, 2026
2 checks passed
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 🎉

维护者验证:rebase 到最新 main 后全量回归 2805 个测试通过;把 price_limits.py/paper.py 还原为旧代码后,新增的 302 用例如预期失败——测试真实有效。问题定位(302132.SZ 中航成飞、±20% 口径)和覆盖面梳理都很到位。

另外我在合并后补了一处你这批 PR 之外的遗漏:strategy/engine.py 的科创板分支此前也只有 688(你修了创业板 302 但 689 漏了),已一并对齐。

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
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