fix
This commit is contained in:
parent
97f1a7ce2e
commit
658db450ec
@ -264,7 +264,13 @@ class StaticGrid(IStrategy):
|
||||
grid_manager = self.grid_managers[pair]
|
||||
|
||||
# 同步 Trade 对象的信息到 GridManager(用于加仓决策)
|
||||
grid_manager.sync_from_trade_object(trade, self.dp.current_candle().get('candle_index', 0))
|
||||
# 使用 trade.open_date_utc 的时间戳作为 candle_index
|
||||
try:
|
||||
candle_index = int(trade.open_date_utc.timestamp() / 3600) if trade.open_date_utc else 0
|
||||
except:
|
||||
candle_index = 0
|
||||
|
||||
grid_manager.sync_from_trade_object(trade, candle_index)
|
||||
|
||||
# 询问网格管理器是否应该加仓
|
||||
adjustment = grid_manager.decide_adjustment()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user