Hi SautaRoc!
Dieses kleine Script verwende ich regelmäßig.
Getestet mit MT5, für MT4 sollte es eigentlich auch funktionieren.
Den Namen des Templates am besten im Sourcecode ändern.
Code:
//+------------------------------------------------------------------+
//| Apply_Template.mq5 |
//| Copyright © 2016 Ing. Otto Pauser |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2016 Ing. Otto Pauser"
#property link ""
#property version "1.00"
#property description "Simple Script for ChartApplyTemplate in all charts opened"
#property script_show_inputs
#include <Charts\Chart.mqh>;
input string template_name = "PlainCandles"; // Name of Template (without '.tpl')
void OnStart()
{
long currChart=ChartFirst();
while(currChart>=0)
{
if(!ChartApplyTemplate(currChart, template_name+".tpl"))
{
Print("Error:",GetLastError()," Template "+template_name+".tpl nicht gefunden ");
break;
}
currChart=ChartNext(currChart);
}
PlaySound("ok");
}
Ich hoffe es ist das, was du brauchst.
Grüße vom OPA-Trader