mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 15:44:18 +08:00
fix(client): 历史资金流当日行全零 + 主力净额列缺失(issue #52)
三个根因(全部实测核实): 1. Category 22 直连接口为虚构协议——52 台已知服务器中 46 台可达的 全部仅回 2 字节空包,从未成功过;移除死代码与臆造解析格式。 2. 历史逐笔接口当日数据要收盘清算后才有,日 K 盘中已含当日 bar, 故 start=0 的最新一行恒为全 0——当日 bar 改走当日实时逐笔接口。 3. main_net_inflow 此前仅为 dataclass property,asdict 静默丢弃, 返回 DataFrame 无主力净额列——新增 _fund_flow_df_with_net 物化 (history 紧随 date 列、当日快照放首列)。 sync + async 双客户端同步修改;更新示例与三份文档;重写/新增回归 测试(当日实时逐笔路径、主力净额列断言)。
This commit is contained in:
@@ -329,10 +329,10 @@ c.get_block_info(filename: str) -> list[TdxBlock]
|
||||
### get_fund_flow
|
||||
|
||||
```python
|
||||
c.get_fund_flow(market: Market, code: str) -> FundFlow
|
||||
c.get_fund_flow(market: Market, code: str) -> pd.DataFrame
|
||||
```
|
||||
|
||||
获取个股当日资金流向(基于 L1 逐笔数据统计)。
|
||||
获取个股当日资金流向(基于 L1 逐笔数据统计)。返回含 `main_net_inflow`(主力净流入)列。
|
||||
|
||||
**资金分级**:
|
||||
| 级别 | 单笔成交额 |
|
||||
@@ -346,10 +346,12 @@ c.get_fund_flow(market: Market, code: str) -> FundFlow
|
||||
|
||||
```python
|
||||
c.get_history_fund_flow(market: Market, code: str,
|
||||
start: int, count: int) -> list[HistoricalFundFlow]
|
||||
start: int, count: int) -> pd.DataFrame
|
||||
```
|
||||
|
||||
获取历史日线资金流向序列。优先走直连接口,若服务器不支持则自动回退为逐笔成交重算。
|
||||
获取历史日线资金流向序列,由"日K线取日期 + 逐笔成交重算"实现(标准服务器
|
||||
无资金流专用指令,Issue #52)。当日 bar 盘中取当日实时逐笔。返回列含
|
||||
`main_net_inflow`(主力净流入,单位元)。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user