docs(reorg): futu 第二数据源接入探索 (Q5 参考) - #9
Merged
Merged
Conversation
探索 futu-api 作为第二数据 provider 的接入方案,回应 business_line_reorg
§8 Q5(provider 协议不应被 yfinance 形状绑架)。不含代码、不新增 ADR、
不改动已 Accepted 的 ADR 0011/0012 结论。
- 连通性:SDK + OpenD 均已安装,2026-03 实机验证过;OpenD 当前未运行、
需交互登录。US 实时行情需付费权限,期权元数据不受限。
- 字段清单:静态链 + subscribe 动态报价三段式;bid/ask 缺失、IV 为百分比、
inTheMoney 需自算;Greeks 是 futu 相对 yfinance 的增量。
- 映射:内部契约 {ticker, spot, expiries, chain{exp:{calls,puts DF}}};
iv/100、itm 由 strike vs spot 推导、bid/ask 置 NaN;ticker 转换已有
utils/ticker_utils.py。
- 防竞争四道缝:provider 列作真判别键、独立限流器(不复用 yf_throttle)、
显式 provider 选择 + 按市场路由、实时期权数据不落库故按
(ticker, provider) 缓存。
- 部署:OpenD 是有状态、需鉴权、GUI 优先的本地常驻进程,是相对 yfinance
真正的运维成本;分 F0–F4 阶段。
- base.py 协议草图(对照 yfinance + futu 双方)。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…r-exploration # Conflicts: # docs/plans/business_line_reorg.md
CI's lint-and-test job runs ruff format --check over the whole repo, which includes Python fences inside markdown; the base.py protocol sketch had a missing space in a Literal and two over-aligned trailing comments. Co-Authored-By: Claude Sonnet 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.
目的
探索 futu-api 作为第二数据 provider 的接入方案,回应
business_line_reorg.md§8 Q5:providers/base.py协议必须同时对照 yfinance 和 futu 两边设计,避免被 yfinance 形状绑架。不含代码、不新增 ADR、不改动已 Accepted 的 ADR 0011/0012 结论。 纯文档,
docs/plans/futu_provider_integration.md新增 +business_line_reorg.md§8/§9 加交叉引用。结论速览
futu-api 9.5.5508与Futu_OpenD.app均已安装,2026-03 实机验证过(AAPL 26 个到期日 / 158 合约)。当前 OpenD 未运行且需交互登录。{ticker, spot, expiries, chain{exp:{calls,puts DF}}},列strike/bid/ask/lastPrice/impliedVolatility(小数)/openInterest/volume/inTheMoney。差异点:iv/100、itm由 strike vs spot 推导、bid/ask置NaN。ticker 转换utils/ticker_utils.py已就绪。provider列作真判别键;独立限流器(绝不复用yf_throttle());显式 provider 选择 + 按市场路由(HK/CN → futu,US → yfinance);实时期权数据不落库(ADR 0004)故按(ticker, provider)缓存。内容
spot在 US 盘后不可用的处理链)+base.py协议草图检查
python scripts/doc_guard.py— clean(pre-commit 全绿)🤖 Generated with Claude Code