mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 14:34:18 +08:00
perf: /watchlist/returns 取数 800 → 20 根(MAC 单页,冷路径请求减半)
实测 MAC 服务端 QFQ 复权锚与请求窗口无关(count=11 vs 800 收盘价 完全一致),数学上 max(DEFAULT_WINDOWS)+1=11 根即够,+10 缓冲; 800 根在 MAC 协议上是 2 页请求,纯属浪费。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -363,9 +363,10 @@ def test_watchlist_returns_ok(monkeypatch, tmp_path):
|
||||
assert item["anchors"][0]["close"] == pytest.approx(10.0 + _IDX_D3)
|
||||
assert item["anchors"][1]["close"] == pytest.approx(10.0 + _IDX_D5)
|
||||
assert item["anchors"][2]["close"] == pytest.approx(10.0 + _IDX_D10)
|
||||
# /bars 同款语义:MAC + QFQ + count=800
|
||||
# /bars 同款语义:MAC + QFQ + 按窗口推导的 count(单页请求,不取 800 根)
|
||||
assert {k["adjust"] for k in mac.kwargs} == {Adjust.QFQ}
|
||||
assert {k["count"] for k in mac.kwargs} == {800}
|
||||
assert {k["count"] for k in mac.kwargs} == {mod._BAR_COUNT}
|
||||
assert mod._BAR_COUNT < 700 # MAC 单页上限内,1 次请求
|
||||
assert set(mac.calls) == {"000001", "600519", "002594"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user