Download MetaTrader 5

Add template to all open charts

To add comments, please log in or register
Christopher Marshall
14
Christopher Marshall  

Forgive my ignorance here, but where would I need to post a development request for an update to the Metatrader Software to include an option to add a selected template to all open charts?

Hope someone can help.

honest_knave
Moderator
2322
honest_knave  
Do Hung
151
Do Hung  
Save your designed template with name "default.tpl"
Isho888
8
Isho888  
Do Hung:
Save your designed template with name "default.tpl"
If I have already set up the default.tpl and I want to make a small changes to one of the graphs and I want to apply to other open graphs, how can i ?
whroeder1
18230
whroeder1  
Make the change, save a template, apply to other charts.
hdemarco
26
hdemarco  
Isho888:
If I have already set up the default.tpl and I want to make a small changes to one of the graphs and I want to apply to other open graphs, how can i ?

Here is a script that I use to do this:

//+------------------------------------------------------------------+
//|                                                     Template.mq5 |
//|                                                 Henrique Demarco |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Henrique Demarco"
#property link      ""
#property version   "1.00"

   long nextChart, currChart=ChartFirst();
   int i=0, limit=100;

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {

//Atualizar todos os gráficos com o template padrão
   while(i<limit)
     {
      ChartApplyTemplate(currChart,"default.tpl");
      Print(i,"-",ChartSymbol(currChart)," ID =",currChart);
      currChart=ChartNext(currChart); // Get the new chart ID by using the previous chart ID
      if(currChart<0) break;          // Have reached the end of the chart list
      i++;// Do not forget to increase the counter
     }

   
  }
//+------------------------------------------------------------------+

Consider that your template filename must be 'default.tpl' and must be saved in 'terminal folder/Profiles/Templates'. I am also assuming you don't have more than 100 charts open.

If you need any change, I am sure you can handle by yourself.

Best regards and have fun.

To add comments, please log in or register