集成pointer_index自动更新到update_state方法 - 价格变化时自动调整指针位置

This commit is contained in:
zhangkun9038@dingtalk.com 2025-11-27 23:25:47 +08:00
parent 675b51237d
commit 0a47e57d3b

View File

@ -285,7 +285,13 @@ class GridManager:
if current_price < self.lowest_price:
self.lowest_price = current_price
# 统计网格状态
# ✅ 自动更新 pointer_index根据价格变化
move_steps = self.update_pointer_by_price(current_price)
if move_steps != 0:
print(f"[GridManager] {self.pair} 指针自动移动 {move_steps}",
file=sys.stderr, flush=True)
# ... existing code ...
filled_count = sum(1 for gs in self.grid_states.values() if gs.status == "filled")
empty_count = len(self.grid_states) - filled_count