fix(ex): 期货/期权K线 amount 恒 0 + 补齐持仓量 position 字段 (#17)
- 0x23FF 帧内无成交额槽位(协议语义,非解析遗漏),期货/期权 amount 按 close×vol×合约乘数 估算(新增 ex_multiplier 乘数表,覆盖 cffex/shf/dl/zz/gz 主流品种 + 股票期权 10000;未知品种保持 0.0 不编造) - position(持仓量)协议层早已解析但 api 层丢弃,v3 起透传至 SecurityBar.position(权益类市场无此概念 → None) - 缓存 schema v2→v3:旧缓存 amount 恒 0/无 position,自然失效重建 - 真机验证:rb2611/IFL0/au2611/上交所期权 10011425 日线 amount/settle/position 全部有值
This commit is contained in:
1 parent
1cd8f692a1
commit
7c4541a315
6 files changed
+187
-18
No files matched your search
@@ -99,7 +99,7 @@ def test_bar_replaces_split_time_with_datetime(backend):
|
||||
df = to_frame([bar(), bar(minute=30)], backend=backend)
|
||||
assert cols(df, backend) == [
|
||||
"market", "code", "open", "high", "low", "close", "vol", "amount",
|
||||
"datetime", "trading_date", "symbol", "settle",
|
||||
"datetime", "trading_date", "symbol", "settle", "position",
|
||||
]
|
||||
assert rows(df, backend) == 2
|
||||
assert cell(df, backend, "market") == 1
|
||||
@@ -122,7 +122,7 @@ def test_empty_list_falls_back_to_annotation_hint(backend):
|
||||
assert rows(df, backend) == 0
|
||||
assert cols(df, backend) == [
|
||||
"market", "code", "open", "high", "low", "close", "vol", "amount",
|
||||
"datetime", "trading_date", "symbol", "settle",
|
||||
"datetime", "trading_date", "symbol", "settle", "position",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user