//+------------------------------------------------------------------+ //| ApplyATemplate.mq4 | //| Copyright 2018, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2018, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.01" #property strict #property script_show_inputs input string templatename="MMEA_131861550753490699.tpl"; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { Print("MT4 Build ",TerminalInfoInteger(TERMINAL_BUILD)); Print(TerminalInfoString(TERMINAL_DATA_PATH)); //--- if(!ChartApplyTemplate(ChartID(),"\\Files\\"+templatename)) { int err=GetLastError(); printf("ERROR %i while applying template \\Files\\%s to chart %lli",err,templatename,ChartID()); } else { printf("Template %s sent to queue %lli.",templatename,ChartID()); } } //+------------------------------------------------------------------+