1
This commit is contained in:
parent
e205ff2ab1
commit
4206258dfe
@ -94,8 +94,9 @@ class HyperliquidExecutor(BaseExecutor):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
# 成交后单独设置止盈止损(Hyperliquid 不支持下单时设置 TP/SL)
|
# 成交后设置止盈止损(Hyperliquid 不支持下单时设置 TP/SL)
|
||||||
if order_status == 'filled' and (stop_loss or take_profit):
|
# 市价单已成交直接设置;限价单(resting)也先设置,等成交后生效
|
||||||
|
if stop_loss or take_profit:
|
||||||
tp_sl_result = self.hyperliquid.set_tp_sl(
|
tp_sl_result = self.hyperliquid.set_tp_sl(
|
||||||
symbol=symbol,
|
symbol=symbol,
|
||||||
is_long=is_buy,
|
is_long=is_buy,
|
||||||
@ -104,8 +105,10 @@ class HyperliquidExecutor(BaseExecutor):
|
|||||||
sl_price=stop_loss
|
sl_price=stop_loss
|
||||||
)
|
)
|
||||||
if not tp_sl_result.get('success'):
|
if not tp_sl_result.get('success'):
|
||||||
logger.warning(f" ⚠️ 止盈止损设置失败: {tp_sl_result.get('message')}")
|
logger.warning(f" ⚠️ 止盈止损设置失败: {tp_sl_result.get('error', tp_sl_result.get('message'))}")
|
||||||
result['tp_sl_warning'] = tp_sl_result.get('message')
|
result['tp_sl_warning'] = tp_sl_result.get('error', tp_sl_result.get('message'))
|
||||||
|
else:
|
||||||
|
logger.info(f" ✅ 止盈止损已设置: TP={take_profit}, SL={stop_loss}")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user