fix: zs_id 使用稳定时间戳替代 DataFrame 位置索引
_make_zs_id 原来用 start_klc.index,每次新K线导致 index 偏移, monitor 误判为新中枢,每 tick 都推送。改为 start_klc.start_time, 时间戳不随 DataFrame 窗口偏移变化。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
881c9d5eac
commit
cf9097a540
+2
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user