//+------------------------------------------------------------------+ //| Workspace_Loader_Pro.mq5 | //| Copyright 2025, xxxxxxxx| //+------------------------------------------------------------------+ #property copyright "Copyright 2025, xxxxxxxx" #property version "2.10" // Added Market Watch source option #property description "Opens a configurable set of charts and templates for selected symbols." #property script_show_inputs //--- Input Parameters input bool InpUseMarketWatch = false; // Load ALL symbols from Market Watch? input string InpSymbols = "EURUSD,USDJPY"; // Comma-separated symbols (ignored if Market Watch is used) input group "Chart Configuration 1" input ENUM_TIMEFRAMES InpPeriod_1 = PERIOD_M15; input string InpTemplate_1 = "Default.tpl"; // Template Name (empty to skip) input group "Chart Configuration 2" input ENUM_TIMEFRAMES InpPeriod_2 = PERIOD_M15; input string InpTemplate_2 = "MyTemplates\\trend.ha.base.tpl"; input group "Chart Configuration 3" input ENUM_TIMEFRAMES InpPeriod_3 = PERIOD_CURRENT; input string InpTemplate_3 = ""; input group "Chart Configuration 4" input ENUM_TIMEFRAMES InpPeriod_4 = PERIOD_CURRENT; input string InpTemplate_4 = ""; input group "Chart Configuration 5" input ENUM_TIMEFRAMES InpPeriod_5 = PERIOD_CURRENT; input string InpTemplate_5 = ""; input group "Chart Configuration 6" input ENUM_TIMEFRAMES InpPeriod_6 = PERIOD_CURRENT; input string InpTemplate_6 = ""; input group "Chart Configuration 7" input ENUM_TIMEFRAMES InpPeriod_7 = PERIOD_CURRENT; input string InpTemplate_7 = ""; input group "Chart Configuration 8" input ENUM_TIMEFRAMES InpPeriod_8 = PERIOD_CURRENT; input string InpTemplate_8 = ""; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { string symbols[]; int count = 0; if(InpUseMarketWatch) { // Load from Market Watch int total = SymbolsTotal(true); // true = only selected in Market Watch if(total > 0) { ArrayResize(symbols, total); for(int i=0; i 0) { if(!ChartApplyTemplate(chart_id, templates[j])) { Print("Error applying template '", templates[j], "' to ", symbol); } else { Print("Opened ", symbol, " ", EnumToString(periods[j]), " with ", templates[j]); } } else { Print("Error opening chart for ", symbol); } } } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+