From cf9097a540f02d2aa2e6c43215a3f05069bbce7b Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Tue, 26 May 2026 12:07:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20zs=5Fid=20=E4=BD=BF=E7=94=A8=E7=A8=B3?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E9=97=B4=E6=88=B3=E6=9B=BF=E4=BB=A3=20DataFr?= =?UTF-8?q?ame=20=E4=BD=8D=E7=BD=AE=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _make_zs_id 原来用 start_klc.index,每次新K线导致 index 偏移, monitor 误判为新中枢,每 tick 都推送。改为 start_klc.start_time, 时间戳不随 DataFrame 窗口偏移变化。 Co-Authored-By: Claude Opus 4.7 --- ChanPivotMonitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChanPivotMonitor.py b/ChanPivotMonitor.py index d6e29f7..296704d 100644 --- a/ChanPivotMonitor.py +++ b/ChanPivotMonitor.py @@ -111,9 +111,9 @@ class ChanPivotMonitor: @staticmethod def _make_zs_id(zs) -> tuple: - """生成中枢的稳定标识(基于首笔首K线索引,不依赖 zs.index)""" + """生成中枢的稳定标识(基于首笔首K线时间戳,不随 DataFrame 窗口偏移而变化)""" bi0 = zs.bi_list[0] - return (bi0.start_klc.index,) + return (bi0.start_klc.start_time,) @staticmethod def _find_current_zs(bi_zs_list: list):