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:
awayings
2026-09-11 15:28:48 +08:00
co-authored by Claude Code
parent 5c2d4ff3d1
commit 5ea6914edb
3 changed files with 17 additions and 6 deletions
+3 -2
View File
@@ -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"}