mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 18:04:16 +08:00
fix: xdxr_info 股本字段改用 _decode_volume 解码,单位万股
股本字段(category 2–10 的 panqian_liutong / panhou_liutong / qian_zongguben / hou_zongguben)与成交量字段使用相同的通达信自定义 4 字节浮点格式;原 float(uint32) 直解差约 374 倍。 改用 _decode_volume 后,最近一条 hou_zongguben(3,330,583.75 万股) 与 FinanceInfo.zong_guben / 10000(3,330,583.75 万股)完全吻合。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -263,6 +263,13 @@ def test_xdxr_info_parse():
|
||||
|
||||
assert all(len(r._raw) > 0 for r in recs)
|
||||
|
||||
# share count decode: 通达信自定义浮点,单位万股,与 FinanceInfo.zong_guben/10000 一致
|
||||
stock_recs = [r for r in recs if 2 <= r.category <= 10]
|
||||
last = stock_recs[-1]
|
||||
# 最近一条 hou_zongguben ≈ 3_330_583.75 万股(与 FinanceInfo.zong_guben 33_305_837_500 ÷ 10000 完全吻合)
|
||||
assert last.hou_zongguben is not None
|
||||
assert abs(last.hou_zongguben - 3_330_583.75) < 1.0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# finance_info
|
||||
|
||||
Reference in New Issue
Block a user