This commit is contained in:
2026-09-05 14:30:16 +08:00
parent 2059f87fe5
commit ba1bd93afa
4 changed files with 7 additions and 20 deletions

View File

@@ -73,8 +73,3 @@ class GridTrailingTracker:
with self._lock:
self._peaks.pop(position_key, None)
def retain(self, position_keys) -> None:
"""删除已不在券商持仓中的峰值,避免同代码重新开仓继承旧状态。"""
active = set(position_keys)
with self._lock:
self._peaks = {key: value for key, value in self._peaks.items() if key in active}