This commit is contained in:
薇薇安 2026-01-24 10:56:48 +08:00
parent f2d71d3390
commit b01920cadf
2 changed files with 14 additions and 14 deletions

View File

@ -2793,12 +2793,12 @@ class PositionManager:
position_info['stopLoss'] = entry_price
logger.info(
f"{symbol} [实时监控] 部分止盈后:剩余仓位止损移至成本价 {entry_price:.4f}(保本),"
f"剩余50%仓位追求1.5:1止盈目标"
f"剩余50%仓位追求2.0:1止盈目标"
)
except Exception as e:
logger.error(f"{symbol} [实时监控] 部分止盈失败: {e}")
# 第二目标:1.5:1止盈平掉剩余仓位
# 第二目标:2.0:1止盈平掉剩余仓位
if partial_profit_taken and take_profit_2 is not None and not should_close:
# 计算第二目标对应的保证金百分比(基于剩余仓位)
if position_info['side'] == 'BUY':
@ -2819,7 +2819,7 @@ class PositionManager:
should_close = True
exit_reason = 'take_profit'
logger.info(
f"{symbol} [实时监控] 触发第二目标止盈(1.5:1基于保证金: "
f"{symbol} [实时监控] 触发第二目标止盈(2.0:1基于保证金: "
f"剩余仓位盈亏={remaining_pnl_pct_margin:.2f}% of margin >= 目标={take_profit_2_pct_margin:.2f}% of margin | "
f"当前价={current_price_float:.4f}, 目标价={take_profit_2:.4f}, "
f"剩余数量={remaining_quantity:.4f}"

View File

@ -452,15 +452,15 @@ class TradeRecommender:
else:
stop_loss_pct = (stop_loss_price - entry_price) / entry_price
# 第一目标盈亏比1:1相对于保证金
take_profit_1_pct_margin = stop_loss_pct_margin * 1.0 # 1:1 盈亏比
# 第一目标盈亏比1:1锁定利润并设置保本损建议
take_profit_1_pct_margin = stop_loss_pct_margin * 1.0
take_profit_1 = self.risk_manager.get_take_profit_price(
entry_price, direction, estimated_quantity, leverage,
take_profit_pct=take_profit_1_pct_margin
)
# 第二目标:止损的2.5倍(相对于保证金
take_profit_2_pct_margin = stop_loss_pct_margin * 2.5
# 第二目标:盈亏比2.0:1追求核心波段收益
take_profit_2_pct_margin = stop_loss_pct_margin * 2.0
take_profit_2 = self.risk_manager.get_take_profit_price(
entry_price, direction, estimated_quantity, leverage,
take_profit_pct=take_profit_2_pct_margin
@ -835,16 +835,16 @@ class TradeRecommender:
具体点位
建议挂单价: {limit_price:.4f} USDT
止损价: {stop_loss:.4f} USDT
第一目标: {tp1:.4f} USDT盈亏比1:1
第二目标: {tp2:.4f} USDT盈亏比2.5:1
第一目标: {tp1:.4f} USDT盈亏比1:1建议平仓50%并将止损移至入场价
第二目标: {tp2:.4f} USDT盈亏比2.0:1剩余仓位离场点
持仓周期{expected_hold_time}
退出条件
触及止损立即平仓
触及第一目标可部分止盈或全部止盈
触及第二目标建议全部止盈
持仓超过3天未触及第一目标建议平仓离场重新评估
退出逻辑
触及止损立即离场严格止损
触及第一目标强烈建议平仓 50% 利润并立即将剩余 50% 仓位的止损价调整为您的入场价保本
触及第二目标剩余仓位全部离场锁定波段收益
时间止损若持仓超过 48 小时仍未触及第一目标建议择机平仓
订单失效条件
此限价单建议当日有效若价格未触及挂单价但价格直接{reverse_direction}超过2%{reverse_threshold:.4f} USDT则建议取消订单等待新信号