//+------------------------------------------------------------------+ //| 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