动态步长-fix

This commit is contained in:
zhangkun9038@dingtalk.com 2025-11-27 16:35:04 +08:00
parent 4ae9e506d5
commit 5987112187

View File

@ -200,12 +200,14 @@ class StaticGrid(IStrategy):
if adjustment:
if adjustment.type == AdjustmentType.ENTRY:
# 初始建仓
grid_manager.apply_adjustment(adjustment) # ✅ 更新网格状态
dataframe.loc[dataframe.index[-1], 'enter_long'] = True
dataframe.loc[dataframe.index[-1], 'enter_tag'] = f"grid_entry_{current_price:.0f}"
print(f"[StaticGrid] {pair} 初始建仓信号 @ {current_price:.2f} (ENTRY 设置为 True)",
file=sys.stderr, flush=True)
elif adjustment.type == AdjustmentType.ADD:
# 加仓
grid_manager.apply_adjustment(adjustment) # ✅ 更新网格状态
dataframe.loc[dataframe.index[-1], 'enter_long'] = True
dataframe.loc[dataframe.index[-1], 'enter_tag'] = f"grid_add_{current_price:.0f}"
print(f"[StaticGrid] {pair} 加仓信号 @ {current_price:.2f} (ADD 设置为 True)",