diff --git a/OrdersEA_Smart_Grid_BO.mq5 b/OrdersEA_Smart_Grid_BO.mq5 index 4c3400b..cb2f2aa 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.2" +#property version "5.3" #include #include -#define VERSION "Version 5.2 Smart Grid Breakout BO MT5" +#define VERSION "Version 5.3 Smart Grid Breakout BO MT5" #define MAX_TRADES 600 #define MAX_LOG_TRADES 1200 @@ -114,6 +114,7 @@ input string WeekendSettings = "=== Weekend Protection ==="; input bool InpCloseBeforeWeekend = true; input int InpWeekendCloseHour = 17; input bool InpCancelPendingBeforeWeekend = true; +input int InpMondayStartHour = 7; // Monday: no new grids before this server hour (0 = off) //--- Trade Object CTrade trade; @@ -166,6 +167,7 @@ datetime lastWeeklyScan = 0; //--- Weekend Protection bool weekendCloseExecuted = false; +bool mondayStandDownLogged = false; //--- Master one-shot (1.4) bool masterShutdownDone = false; @@ -451,6 +453,37 @@ bool CheckWeekendProtection() return true; } +//+------------------------------------------------------------------+ +//| Monday Morning Stand-Down (5.3) | +//| Sunday-evening ET liquidity is thin and the pivots/ATR are built | +//| from Friday's session — skip new grids until the configured | +//| Monday server hour. Blocking before the daily pivot recalc also | +//| defers the ATR sample to the resume hour instead of the rollover. | +//+------------------------------------------------------------------+ +bool CheckMondayStandDown() + { + if(InpMondayStartHour <= 0) return true; + MqlDateTime dt; + TimeToStruct(TimeCurrent(), dt); + + if(dt.day_of_week == MONDAY && dt.hour < InpMondayStartHour) + { + if(!mondayStandDownLogged) + { + PrintS("⏸ MONDAY STAND-DOWN — no new grids before " + + IntegerToString(InpMondayStartHour) + ":00 server"); + mondayStandDownLogged = true; + } + return false; + } + if(mondayStandDownLogged) + { + PrintS("Monday stand-down over — normal trading resumed"); + mondayStandDownLogged = false; + } + return true; + } + //+------------------------------------------------------------------+ //| Session Filter (4.1) | //+------------------------------------------------------------------+ @@ -1300,6 +1333,11 @@ void OnTick() if(!CheckWeekendProtection()) return; + // --- Monday morning stand-down (5.3) — must stay above the pivot + // recalc so Monday's pivots/ATR are computed at the resume hour --- + if(!CheckMondayStandDown()) + return; + // --- GetOut mode --- if(GetOut != "N" && GetOut != "n") { diff --git a/bo-audnzd.set b/bo-audnzd.set index 50a2387..a1e1527 100644 --- a/bo-audnzd.set +++ b/bo-audnzd.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=5.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444012 diff --git a/bo-audusd.set b/bo-audusd.set index 62a7774..0cceb67 100644 --- a/bo-audusd.set +++ b/bo-audusd.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444005 diff --git a/bo-eurchf.set b/bo-eurchf.set index b81d51b..d76cc6c 100644 --- a/bo-eurchf.set +++ b/bo-eurchf.set @@ -54,6 +54,7 @@ InpMaxWeeklyDrawdown=5.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444010 diff --git a/bo-eurgbp.set b/bo-eurgbp.set index 9dd9477..91bbfe1 100644 --- a/bo-eurgbp.set +++ b/bo-eurgbp.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=5.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444011 diff --git a/bo-eurjpy.set b/bo-eurjpy.set index 0c78d56..b4a6800 100644 --- a/bo-eurjpy.set +++ b/bo-eurjpy.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444009 diff --git a/bo-eurusd.set b/bo-eurusd.set index 05962f7..7993b59 100644 --- a/bo-eurusd.set +++ b/bo-eurusd.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444001 diff --git a/bo-gbpjpy.set b/bo-gbpjpy.set index 992d50d..37fca98 100644 --- a/bo-gbpjpy.set +++ b/bo-gbpjpy.set @@ -53,6 +53,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444004 diff --git a/bo-gbpusd.set b/bo-gbpusd.set index 9d5f133..968b436 100644 --- a/bo-gbpusd.set +++ b/bo-gbpusd.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444002 diff --git a/bo-major.set b/bo-major.set index ae3431e..17366d8 100644 --- a/bo-major.set +++ b/bo-major.set @@ -54,6 +54,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === Session Notes === ; BO fires on breakout of daily pivot range (ATR-scaled) diff --git a/bo-nzdusd.set b/bo-nzdusd.set index 061ebbe..9cd4923 100644 --- a/bo-nzdusd.set +++ b/bo-nzdusd.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444006 diff --git a/bo-steady.set b/bo-steady.set index d3a9128..9feba88 100644 --- a/bo-steady.set +++ b/bo-steady.set @@ -55,6 +55,7 @@ InpMaxWeeklyDrawdown=5.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === Session Notes === ; Lower volatility = smaller moves but more frequent breakouts of ATR range diff --git a/bo-usdcad.set b/bo-usdcad.set index 3866ba4..31f42db 100644 --- a/bo-usdcad.set +++ b/bo-usdcad.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444007 diff --git a/bo-usdchf.set b/bo-usdchf.set index 0082a8c..aba69be 100644 --- a/bo-usdchf.set +++ b/bo-usdchf.set @@ -53,6 +53,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444008 diff --git a/bo-usdjpy.set b/bo-usdjpy.set index eb1eb5c..d0db0d5 100644 --- a/bo-usdjpy.set +++ b/bo-usdjpy.set @@ -52,6 +52,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444003 diff --git a/bo-volatile.set b/bo-volatile.set index ee011ed..aa42cdf 100644 --- a/bo-volatile.set +++ b/bo-volatile.set @@ -54,6 +54,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === Session Notes === ; GBPJPY/XAUUSD can gap 200+ pts — BO suits them well but cut losses fast diff --git a/bo-xagusd.set b/bo-xagusd.set index ca92fff..1944a56 100644 --- a/bo-xagusd.set +++ b/bo-xagusd.set @@ -53,6 +53,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444014 diff --git a/bo-xauusd.set b/bo-xauusd.set index a387be1..1f10bbf 100644 --- a/bo-xauusd.set +++ b/bo-xauusd.set @@ -53,6 +53,7 @@ InpMaxWeeklyDrawdown=7.0 InpCloseBeforeWeekend=true InpWeekendCloseHour=7 InpCancelPendingBeforeWeekend=true +InpMondayStartHour=7 ; === EA Settings === MagicNum=444013