From 80c2debaba5955f43e0fa27a826bb8acceacf140 Mon Sep 17 00:00:00 2001 From: zhangyangbin Date: Sun, 17 May 2026 14:25:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=80=E5=B0=8F=E6=AD=A2=E6=8D=9F?= =?UTF-8?q?=E7=82=B9=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 20260516-突破策略/20260516_Breakout.mq5 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/20260516-突破策略/20260516_Breakout.mq5 b/20260516-突破策略/20260516_Breakout.mq5 index 76c195f..4a45e5e 100644 --- a/20260516-突破策略/20260516_Breakout.mq5 +++ b/20260516-突破策略/20260516_Breakout.mq5 @@ -20,6 +20,7 @@ input double InpPullbackTolerance = 0.0; // 反向突破容忍度(%) 0= input group "=== 风险管理参数 ===" input double InpStopLossPercent = 0.05; // 止损百分比(%) +input int InpMinStopLossPoints = 100; // 最小止损点数 input double InpRiskRewardRatio = 1.5; // 盈亏比 input bool InpUseTrailingStop = false; // 使用移动止损 input int InpMaxHoldingMinutes = 5; // 最大持仓时间(分钟) @@ -119,7 +120,7 @@ int OnInit() Print("反向突破容忍度: ", DoubleToString(InpPullbackTolerance, 1), "% (启用)"); else Print("反向突破容忍度: 0% (禁用 - 保持原有逻辑)"); - Print("止损:", InpStopLossPercent, "% (最小1美元) | 盈亏比:", InpRiskRewardRatio); + Print("止损:", InpStopLossPercent, "% (最小", InpMinStopLossPoints, "点) | 盈亏比:", InpRiskRewardRatio); Print("移动止损:", (InpUseTrailingStop ? "启用" : "禁用")); Print("最大持仓时间:", InpMaxHoldingMinutes, "分钟"); Print("最大开仓手数:", InpMaxPositions); @@ -743,8 +744,8 @@ bool OpenPosition(ENUM_ORDER_TYPE order_type, double wave_high, double wave_low, // 计算止损和止盈(基于开仓价的百分比) double stop_loss_amount = current_price * InpStopLossPercent / 100.0; - // 确保止损金额不小于1美元(100点) - double min_stop_loss = 1.0; // 1美元 = 100点 + // 确保止损金额不小于最小止损点数 + double min_stop_loss = InpMinStopLossPoints * _Point; if(stop_loss_amount < min_stop_loss) { stop_loss_amount = min_stop_loss; } @@ -873,8 +874,8 @@ void CheckTrailingStop(ulong ticket) // 计算止损金额(开仓价的百分比) double stop_loss_amount = open_price * InpStopLossPercent / 100.0; - // 确保止损金额不小于1美元(100点) - double min_stop_loss = 1.0; // 1美元 = 100点 + // 确保止损金额不小于最小止损点数 + double min_stop_loss = InpMinStopLossPoints * _Point; if(stop_loss_amount < min_stop_loss) { stop_loss_amount = min_stop_loss; }