Change time frame simutaniously for all pairs

 

Hi there,

 

I need your help please...

 

is there any shortcut that change the TF of all pairs that i have opened simutaniously?

 

thanks in advace 

 
You need a script, then you can use it with a hotkey.
 
Spinozagr:

Hi there,

 

I need your help please...

 

is there any shortcut that change the TF of all pairs that i have opened simutaniously?

 

thanks in advace 

It depends what you mean switch the chart or switch your indicator or expert? Or you want all charts to switch at the same time by pressing 1m or 4h once? i had once written an expert that monitored 24 currency pairs on 12 timeframes per pair per tick. It took me about 3500 lines of code if my memory serves me right. If you use the same timeframe value on all pairs it should work but most people seem to be looking for the opposite like more timeframes on one pair at the same time which can all be done the only limit is your imagination.
 
Thecreator1:
It depends what you mean switch the chart or switch your indicator or expert? Or you want all charts to switch at the same time by pressing 1m or 4h once? i had once written an expert that monitored 24 currency pairs on 12 timeframes per pair per tick. It took me about 3500 lines of code if my memory serves me right. If you use the same timeframe value on all pairs it should work but most people seem to be looking for the opposite like more timeframes on one pair at the same time which can all be done the only limit is your imagination.

Just to switch at the same time by pressing 1m or 4h at once....

so can you recommend where i can buy such a script?

 

thank you 

 
Hi, You can try this script
input ENUM_TIMEFRAMES ChangeTimeFrame=PERIOD_H1; // Period Change

void OnStart()
  {
      long currChart = 0;
      while( currChart >= 0 )
         {
            ChartSetSymbolPeriod( currChart,ChartSymbol(currChart),ChangeTimeFrame);
            currChart=ChartNext(currChart);
         }

   
  }
 
biantoro:
Hi, You can try this script

Hi biantoro,


Tried your script which works well if the chart is maximized (then all charts in the current profile switch the timeframe).

But if you have the charts tiled then it only works on one or only a couple of charts. I am not a MQL programmer but

use MT5 for charting. If it is not too much work, would you please fix this?

Thanks and regards,

Alex

 
mark101:

Hi biantoro,


Tried your script which works well if the chart is maximized (then all charts in the current profile switch the timeframe).

But if you have the charts tiled then it only works on one or only a couple of charts. I am not a MQL programmer but

use MT5 for charting. If it is not too much work, would you please fix this?

Thanks and regards,

Alex

Change this line :

   long currChart = 0;

to :

   long currChart=ChartFirst();
 
Spot on, thanks for the support!
Reason: