diff --git a/OrdersEA_Smart_Grid_BO.mq5 b/OrdersEA_Smart_Grid_BO.mq5 index cb2f2aa..12d372c 100755 --- a/OrdersEA_Smart_Grid_BO.mq5 +++ b/OrdersEA_Smart_Grid_BO.mq5 @@ -5,12 +5,12 @@ //+------------------------------------------------------------------+ #property copyright "Copyright 2024, Garfield Heron" #property link "https://fetcherpay.com" -#property version "5.3" +#property version "5.4" #include #include -#define VERSION "Version 5.3 Smart Grid Breakout BO MT5" +#define VERSION "Version 5.4 Smart Grid Breakout BO MT5" #define MAX_TRADES 600 #define MAX_LOG_TRADES 1200 @@ -74,7 +74,10 @@ input int InpBreakevenBufferPoints = 5; // Spread cushion above entry //--- Trailing Stop (5.1) input string TrailingSettings = "=== Trailing Stop ==="; input bool InpUseTrailingStop = false; // Enable trailing stop on open positions -input int InpTrailStart = 1000; // Points of profit before trail activates +// Renamed from InpTrailStart in 5.4 so all charts pick up the new 500pt +// default on recompile (renamed inputs reset to source default; the old +// 1000pt start was reachable on metals only — presets set metals back to 1000). +input int InpTrailStartPoints = 500; // Points of profit before trail activates input int InpTrailStop = 500; // Trail distance behind price (points) //--- Correlation Cap (4.3) @@ -861,12 +864,12 @@ void ApplyBreakeven() void ApplyTrailingStop() { if(!InpUseTrailingStop) return; - if(InpTrailStart <= 0 || InpTrailStop <= 0) return; + if(InpTrailStartPoints <= 0 || InpTrailStop <= 0) return; double point = SymbolInfoDouble(_Symbol, SYMBOL_POINT); double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID); double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); - double trailStart = InpTrailStart * point; + double trailStart = InpTrailStartPoints * point; double trailDist = InpTrailStop * point; for(int i = PositionsTotal() - 1; i >= 0; i--) @@ -1283,7 +1286,7 @@ int OnInit() PrintS(VERSION + " initialized — Magic=" + IntegerToString(MagicNum) + " SL=" + (InpUseStopLoss ? "ON(" + IntegerToString(StopLoss) + ")" : "OFF") + - " Trail=" + (InpUseTrailingStop ? "ON(start=" + IntegerToString(InpTrailStart) + + " Trail=" + (InpUseTrailingStop ? "ON(start=" + IntegerToString(InpTrailStartPoints) + "/dist=" + IntegerToString(InpTrailStop) + "pts)" : "OFF") + " AdaptiveEntry=" + (InpAdaptiveEntry ? "ON" : "OFF")); return INIT_SUCCEEDED; diff --git a/bo-audnzd.set b/bo-audnzd.set index a1e1527..5ac0618 100644 --- a/bo-audnzd.set +++ b/bo-audnzd.set @@ -29,7 +29,7 @@ StopLoss=180 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-audusd.set b/bo-audusd.set index 0cceb67..3e1b272 100644 --- a/bo-audusd.set +++ b/bo-audusd.set @@ -29,7 +29,7 @@ StopLoss=300 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-eurchf.set b/bo-eurchf.set index d76cc6c..593d4d6 100644 --- a/bo-eurchf.set +++ b/bo-eurchf.set @@ -31,7 +31,7 @@ StopLoss=200 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-eurgbp.set b/bo-eurgbp.set index 91bbfe1..d0493a7 100644 --- a/bo-eurgbp.set +++ b/bo-eurgbp.set @@ -29,7 +29,7 @@ StopLoss=200 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-eurjpy.set b/bo-eurjpy.set index b4a6800..174edac 100644 --- a/bo-eurjpy.set +++ b/bo-eurjpy.set @@ -29,7 +29,7 @@ StopLoss=400 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-eurusd.set b/bo-eurusd.set index 7993b59..f3ae42e 100644 --- a/bo-eurusd.set +++ b/bo-eurusd.set @@ -29,7 +29,7 @@ StopLoss=300 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-gbpjpy.set b/bo-gbpjpy.set index 37fca98..d524689 100644 --- a/bo-gbpjpy.set +++ b/bo-gbpjpy.set @@ -30,7 +30,7 @@ StopLoss=800 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-gbpusd.set b/bo-gbpusd.set index 968b436..b7310c8 100644 --- a/bo-gbpusd.set +++ b/bo-gbpusd.set @@ -29,7 +29,7 @@ StopLoss=350 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-major.set b/bo-major.set index 17366d8..b68fe72 100644 --- a/bo-major.set +++ b/bo-major.set @@ -31,7 +31,7 @@ StopLoss=300 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-nzdusd.set b/bo-nzdusd.set index 9cd4923..9767451 100644 --- a/bo-nzdusd.set +++ b/bo-nzdusd.set @@ -29,7 +29,7 @@ StopLoss=280 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-steady.set b/bo-steady.set index 9feba88..77edef1 100644 --- a/bo-steady.set +++ b/bo-steady.set @@ -32,7 +32,7 @@ StopLoss=200 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-usdcad.set b/bo-usdcad.set index 31f42db..1a2db3a 100644 --- a/bo-usdcad.set +++ b/bo-usdcad.set @@ -29,7 +29,7 @@ StopLoss=300 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-usdchf.set b/bo-usdchf.set index aba69be..1b8ea45 100644 --- a/bo-usdchf.set +++ b/bo-usdchf.set @@ -30,7 +30,7 @@ StopLoss=280 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-usdjpy.set b/bo-usdjpy.set index d0db0d5..c7a71d1 100644 --- a/bo-usdjpy.set +++ b/bo-usdjpy.set @@ -29,7 +29,7 @@ StopLoss=300 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-volatile.set b/bo-volatile.set index aa42cdf..0ec08c1 100644 --- a/bo-volatile.set +++ b/bo-volatile.set @@ -31,7 +31,7 @@ StopLoss=800 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=500 InpTrailStop=500 ; === Risk Management === diff --git a/bo-xagusd.set b/bo-xagusd.set index 18cba61..bfae760 100644 --- a/bo-xagusd.set +++ b/bo-xagusd.set @@ -35,7 +35,7 @@ StopLoss=1000 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=1000 InpTrailStop=500 ; === Risk Management === diff --git a/bo-xauusd.set b/bo-xauusd.set index 1f10bbf..4031a88 100644 --- a/bo-xauusd.set +++ b/bo-xauusd.set @@ -30,7 +30,7 @@ StopLoss=1500 ; === Trailing Stop === InpUseTrailingStop=true -InpTrailStart=1000 +InpTrailStartPoints=1000 InpTrailStop=500 ; === Risk Management ===