fix: 股票列表纳入科创板 688 与创业板 301 段#9
Merged
Merged
Conversation
- 上海正则 688\d{4} 共 7 位永远匹配不上 6 位代码,科创板自始被静默排除;改为 ^(60\d{4}|688\d{3})$
- 深圳正则补 301(创业板注册制段)
- 689(CDR)/B股/ETF/转债/北证/TDX指数段维持排除(18 用例正则单测通过)
- 北证 vipdoc/bj 目录本期不纳入
影响:下次 sync 将增量拉取 688/301 全历史日线+分钟线;
上市满一年(ma233)后才进入 wavecrest 强弱计算
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pytdx get_security_type 不识别 688(code_head '68' 无分支,返回 None), get_df 会 print 噪音 + raise NotImplementedError,被 cli 逐股票循环吞掉—— 仅修股票列表正则后 688 仍会 0 行入库。 先检查 sec_type,不支持时走 _read_day_file_raw 直接解析二进制, 系数与 pytdx SH_A_STOCK 一致(价格/volume ×0.01, amount 原样)。 合成数据验证:与 pytdx get_df 输出逐字节相等。 分钟线 TdxLCMinBarReader 无类型检查,不受影响。 实现移植自 PR #6(jaden1q84),致谢。 Co-Authored-By: jaden1q84 <jaden1q84@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
688\d{4}共 7 位,永远匹配不上 6 位的科创代码——科创板自项目建立起被静默排除(正则里写了 688,原意就是要包含)。改为^(60\d{4}|688\d{3})$301(创业板注册制段,2021 年起已发行数百只)get_security_type不识别 688,get_df会 raise NotImplementedError 被逐股票循环吞掉——仅修正则 688 仍 0 行入库。先检查 sec_type,不支持时走_read_day_file_raw直接解析二进制(系数与 SH_A_STOCK 一致)。此实现移植自 PR fix: 修复 SQLite 写入时 pd.Timestamp 绑定错误 #6(@jaden1q84),commit 已 Co-authored-by 致谢TdxLCMinBarReader无类型检查,688 的 .lc5 不受影响vipdoc/bj/目录本期不纳入与 PR #6 的关系
PR #6 包含同样的正则修复与 raw 解析(实现一致),但同时混入了表结构改造(code 加 .SZ/.SH 后缀)、volume/amount 单位变更、默认前复权、日线专用包重构等大型变更,本 PR 仅取最小修复集。
Test plan
_read_day_file_raw合成数据验证:与 pytdxget_df(SH_A_STOCK) 输出逐字节相等python main.py stock-list --db-only,确认 stock_info 新增 sh688/sz301python main.py sync,确认 daily_data 出现 688/301 全历史SELECT LEFT(code,5), COUNT(DISTINCT code) FROM daily_data WHERE code ~ '(sh688|sz301)' GROUP BY 1🤖 Generated with Claude Code