From b3c16e86a23555f162ccfd60f70bbeebac69a281 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Thu, 4 Dec 2025 10:40:44 +0100 Subject: [PATCH] new files added --- Scripts/MyScripts/Close_Charts_By_Symbol.mq5 | 102 +++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Scripts/MyScripts/Close_Charts_By_Symbol.mq5 diff --git a/Scripts/MyScripts/Close_Charts_By_Symbol.mq5 b/Scripts/MyScripts/Close_Charts_By_Symbol.mq5 new file mode 100644 index 0000000..80d92c8 --- /dev/null +++ b/Scripts/MyScripts/Close_Charts_By_Symbol.mq5 @@ -0,0 +1,102 @@ +//+------------------------------------------------------------------+ +//| Close_Charts_By_Symbol.mq5 | +//| Copyright 2025, xxxxxxxx| +//+------------------------------------------------------------------+ +#property copyright "Copyright 2025, xxxxxxxx" +#property version "1.00" +#property description "Closes charts matching the specified symbols." +#property script_show_inputs + +//--- Input Parameters +input string InpSymbols = ""; // Symbols to close (comma-separated). Leave empty to ignore. +input bool InpCloseAll = false; // DANGER: Close ALL charts in terminal? + +//+------------------------------------------------------------------+ +//| Script program start function | +//+------------------------------------------------------------------+ +void OnStart() + { + if(InpSymbols == "" && !InpCloseAll) + { + Alert("Please specify symbols or check 'Close All'."); + return; + } + + if(InpCloseAll) + { + int ret = MessageBox("Are you sure you want to close ALL charts?", "Confirm Close All", MB_YESNO | MB_ICONWARNING); + if(ret == IDNO) + return; + } + + string symbols_to_close[]; + int target_count = StringSplit(InpSymbols, ',', symbols_to_close); + +// Trim spaces + for(int i=0; i