Repository navigation
feat(news): 市场资讯模块(要闻速递 + 84 频道)+ 期货命名文档 - #31
Merged
Merged
Conversation
补充 EXTENDED_MARKET.md 期货章节,回答「扩展行情是否支持分时」并记录
两个容易踩的坑:
- **连续合约命名不是 L0**:扩展行情用 ``{品种}L7/L8/L9``,服务端名称分别为
「次连 / 主连 / 加权」。实测沪金 AUL8 的 pre_close/open/high/low/close/vol
与主力 AU2612 逐项相同,确认 L8 = 主力连续;L7(883.90)/ L9(883.12)
与主力(881.46)不同。69 个品种各三个连续代码。
- **分时支持,但历史分时的 summary 不可用**:goods_tick_chart(30, "AUL8")
当日 555 点(21:00 夜盘 → 14:59 日盘,随品种交易时段变化,不是固定 240);
传 query_date 取往日分时,charts 逐点价格完整但 open/high/low/close 汇总为 0,
只有 pre_close 有值。
- 另记录 momentum 字段按 float32 解析出 3e-40 垃圾值(疑似整型/保留位),
文档标注忽略该字段;time/price/avg/vol 均正确。
- 附可直接运行的示例(分时 + 缩略采样 112 点 + 1/5/60 分钟与日线各 700 根),
全部实测验证通过。
新增的 `client.f10.market_news()` / `channel_news()` / `news_channels()` 此前只在 methods/F10-市场资讯.md 有单页说明,其余入口文档全部缺失, 使用者按 CLI / MCP / API 任一入口查都找不到它。 补的 5 处: - `docs/CLI.md`:`eltdx f10` 的 action 表补 `news-channels` / `market-news` / `channel-news`,并标出 `--tab` 的 8 个取值 - `docs/MCP.md`:工具表补 `eltdx_market_news` / `eltdx_channel_news` / `eltdx_news_channels` - `docs/API_REFERENCE.md`:新增「市场资讯」小节(资讯流不走 code+section 分派, 单独成节说明三个方法与底层 Entry) - `docs/METHOD_REFERENCE.md`:常用 F10 方法表补三行,含完整签名 - `docs/F10_7615.md`:新增「市场资讯(tdxi_zxxw*)」章节,登记两个 Entry 并补锚点,供其它文档的 `#entry-*` 引用 配套: - 新增 `tests/test_news.py`(9 条):枚举值、`news_channels()` 排序与 84 个频道、 请求 Entry 与 Params 顺序、未知值降级为数字、`extract_news_rows` 取第 2 个结果集 以及缺表/无属性时的空返回 - 登记到 `tests/contracts/manifests/python_test_groups.json` 的 round4-local 验证:`sync_docs --check` 一致;`mkdocs build --strict` 0 warning; `ruff check` 通过;`1608 passed`(本机 34 个 `test_protocol_unit` 失败是 `_native.pyd` 编译产物过期所致,纯净 upstream/main 上同样失败)。
Contributor
Author
|
这是我手头最后一个PR了。 |
Owner
|
感谢补齐市场资讯接口和文档。我把当前 main(f603734)与本 PR 的 eecf3e8 合并到临时目录做了复核:
本 PR 新增 3 个 MCP 工具后,总数已经是 35; 调用链是 请把这两行中的工具数从 32 同步为 35(断言和报错文本),再跑一次安装包 smoke。我已在临时副本只调整这两个数字,用同一个真实 wheel 验证通过。 这轮复核未发现其他阻塞项,补齐这一处后再合并即可。 |
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.
摘要
在已合并的 #30 之上,新增市场资讯模块:用两个 7615 免登录 Entry 取全市场资讯流。
client.f10.market_news(tab=3, *, page=1, page_size=50)—— 资讯首页顶部要闻流,CWServ.tdxi_zxxwsy;tab取 1 滚动 / 2 今日焦点 / 3 要闻速递 / 4 正面 / 5 负面 / 6 精华 / 7 最新提示 / 9 机构调研client.f10.channel_news(channel, *, page=1, page_size=50, query1="1", keyword="")—— 按频道号取栏目资讯,CWServ.tdxi_zxxwnews,共 84 个频道(财经 / 股票 / 新股 / 港股 / 美股 / 基金 / 期货 / 理财 / 外汇 / 债券 / 期权)client.f10.news_channels()—— 频道号与中文名(静态枚举,不发请求)资讯流不走
code+section分派,与个股 F10 是两条独立通道;新闻行在响应result_sets[1].rows,用extract_news_rows()提取。顺带把「期货分时与连续合约命名」文档补进
EXTENDED_MARKET.md(沪金主连 =AUL8)。提交
388f94efeat(news)f10/news.py)+ CLI 三个子命令 + MCP 三个工具 + 单页文档30d3dacdocs(ex)AUL8)eecf3e8docs(news)test_news.py文档补齐(本次重点)
新模块此前只有
methods/F10-市场资讯.md单页,按 CLI / MCP / API 任一入口查都找不到。补齐:docs/CLI.md——eltdx f10action 表:news-channels/market-news/channel-news,标注--tab的 8 个取值docs/MCP.md—— 工具表:eltdx_market_news/eltdx_channel_news/eltdx_news_channelsdocs/API_REFERENCE.md—— 新增「市场资讯」小节,说明三个方法与底层 Entrydocs/METHOD_REFERENCE.md—— 常用 F10 方法表补三行,含完整签名docs/F10_7615.md—— 新增「市场资讯(tdxi_zxxw*)」章节,登记两个 Entry 并补#entry-*锚点docs/methods/README.md—— 索引(原提交已含)测试
新增
tests/test_news.py(9 条,离线):NewsHomeTab枚举值(8 个,query=8前端已停用故不收录)news_channels()排序、84 个频道、元素类型market_news/channel_news的 Entry 与Params顺序(含默认值["3","1","50"])extract_news_rows取第 2 个结果集,缺表或无result_sets时返回空列表已登记到
python_test_groups.json的 round4-local。验证
1608 passed,ruff check通过sync_docs --check:docs/与src/eltdx/docs/镜像一致mkdocs build --strict:0 warning(含新增页面与全部相对链接)Cargo/CHANGELOG/releases/interface-catalog/check_release_*均未改动)本机 36 个失败与本次改动无关:34 个
test_protocol_unit.py可转债volume_lots用例是src/eltdx/_native.pyd编译产物过期(纯净upstream/main上同样失败),另 2 个为已知环境限制(版本断言、verify_wheel_matrix不支持 Windows)。