Copy EA Presets to multiple charts

 

Hello!


I am demo-testing EAs in multiple pairs. Sometimes I want to modify the EA inputs in all of the charts at the same time and it's very cumbersome, boring, and time-consuming, to
-press F7 to open the EA

-click over to Inputs Tab (because it always open in the first About Tab)

-click Load to load the Presets file

-double-click the presets file


Easy enough... but now do that 28 times in a row... only to realize you forgot something in the inicial saved preset and have to do it all over again!


So I would like to be able to copy the Presets file over to all open charts.


I know about copying the same template to all charts and I even use a script to do that using ChartApplyTemplate(). But in this case I don't want the same template in all the charts (as I am displaying different indicators in several charts) and because by doing so I will loose the lines that indicate when positions were opened and closed, and I would to analyse those later.


The best I could do is a long workaround that implies using a mass-project-editing tool (I use Atom, but could be Notepad++) go into the Metatrader4 Profiles folder I am currently using and do a search/replace in all the files there for all occurrences of a parameter I want to change, for example "SendEmailAlerts=false" and replace by "SendEmailAlerts=true".
This means I need to quit Metatrader first, then do the batch-search&replace to modify the files and then launch Metatrader4 again to load the charts with the changed parameters.


In short, does anyone know a simple way to copy/load JUST the Presets file into all of the charts?


Thank you!

 

save template as "default"

just type: default.


then ctrl+F6 to Cycle through charts

 
FERNANDO MANUE GASPAR MARTINS:

Hello!


I am demo-testing EAs in multiple pairs. Sometimes I want to modify the EA inputs in all of the charts at the same time and it's very cumbersome, boring, and time-consuming, to
-press F7 to open the EA

-click over to Inputs Tab (because it always open in the first About Tab)

-click Load to load the Presets file

-double-click the presets file


Easy enough... but now do that 28 times in a row... only to realize you forgot something in the inicial saved preset and have to do it all over again!


So I would like to be able to copy the Presets file over to all open charts.


I know about copying the same template to all charts and I even use a script to do that using ChartApplyTemplate(). But in this case I don't want the same template in all the charts (as I am displaying different indicators in several charts) and because by doing so I will loose the lines that indicate when positions were opened and closed, and I would to analyse those later.


The best I could do is a long workaround that implies using a mass-project-editing tool (I use Atom, but could be Notepad++) go into the Metatrader4 Profiles folder I am currently using and do a search/replace in all the files there for all occurrences of a parameter I want to change, for example "SendEmailAlerts=false" and replace by "SendEmailAlerts=true".
This means I need to quit Metatrader first, then do the batch-search&replace to modify the files and then launch Metatrader4 again to load the charts with the changed parameters.


In short, does anyone know a simple way to copy/load JUST the Presets file into all of the charts?


Thank you!

I don't understand why you are trying to do it this way when you can trade in all parities and timeframes with 1 single indicator or EA. You can provide it by adding the following piece of code.


void OnStart()
  {
//---
    long currChart,prevChart=ChartFirst(); 
   int i=0,limit=100; 
   Print("ChartFirst =",ChartSymbol(prevChart)," ID =",prevChart); 
   while(i<limit)// We have certainly not more than 100 open charts 
     { 
      currChart=ChartNext(prevChart); // Get the new chart ID by using the previous chart ID 
      if(currChart<0) break;  
     // Print(ChartID(),ObjectsTotal(currChart)," rr");
              // Have reached the end of the chart list 
      Print(i,ChartSymbol(currChart)," ID =",currChart," Object Totals ",ObjectsTotal(currChart));
      for(int ix=0;ix<ObjectsTotal(currChart)-1;ix++)
        {
          Print(ObjectName(currChart,ix)," For ", ChartSymbol(currChart));
        } 
      prevChart=currChart;// let's save the current chart ID for the ChartNext() 
      i++;// Do not forget to increase the counter 
     }
  }
ChartIndicatorsTotal()

ChartIndicatorName()

ObjectDescription()

bool  ChartApplyTemplate( 
   long          chart_id,     // Chart ID 
   const string  filename      // Template file name 
   );
 
FERNANDO MANUE GASPAR MARTINS:

Hello!


I am demo-testing EAs in multiple pairs. Sometimes I want to modify the EA inputs in all of the charts at the same time and it's very cumbersome, boring, and time-consuming, to
-press F7 to open the EA

-click over to Inputs Tab (because it always open in the first About Tab)

-click Load to load the Presets file

-double-click the presets file


Easy enough... but now do that 28 times in a row... only to realize you forgot something in the inicial saved preset and have to do it all over again!


So I would like to be able to copy the Presets file over to all open charts.


I know about copying the same template to all charts and I even use a script to do that using ChartApplyTemplate(). But in this case I don't want the same template in all the charts (as I am displaying different indicators in several charts) and because by doing so I will loose the lines that indicate when positions were opened and closed, and I would to analyse those later.


The best I could do is a long workaround that implies using a mass-project-editing tool (I use Atom, but could be Notepad++) go into the Metatrader4 Profiles folder I am currently using and do a search/replace in all the files there for all occurrences of a parameter I want to change, for example "SendEmailAlerts=false" and replace by "SendEmailAlerts=true".
This means I need to quit Metatrader first, then do the batch-search&replace to modify the files and then launch Metatrader4 again to load the charts with the changed parameters.


In short, does anyone know a simple way to copy/load JUST the Presets file into all of the charts?


Thank you!

you should use a flexible code for all of the charts and run the expert for all of them...if u want to perform different functions to every chart, u can partition ur coding and before using the expert, turn off the other parts that is related to another currency...at last u can utilize ctrl+F function and replace rapidly insead of closing meta...