Help in looping symbols and timeframes in MQL5

 

I've been trying to code my strategy into an EA and i use all symbols and all timeframes when using my scalping strategy, i've been trying to do the same with the EA and end up with some error, i am still a little new to coding and my code may be completely wrong but someone help me out. If im using iRSI for example, i want to enter sym for symbol and and TF for period in the parameters.


  int symbol= SymbolsTotal(1);
  for(int sym=0;sym<symbol;sym++)

  ENUM_TIMEFRAMES period[10]={PERIOD_M1,PERIOD_M2,PERIOD_M3,PERIOD_M4,PERIOD_M5,PERIOD_M6,PERIOD_M10,PERIOD_M12,PERIOD_M15,PERIOD_M20};
  for(int TF=0;TF<10;TF++)
 
for(…) enum{…} makes no sense. You can't execute a declaration.
  ENUM_TIMEFRAMES period[10]={PERIOD_M1,PERIOD_M2,PERIOD_M3,PERIOD_M4,PERIOD_M5,PERIOD_M6,PERIOD_M10,PERIOD_M12,PERIOD_M15,PERIOD_M20};
  int symbol= SymbolsTotal(1);
  for(int sym=0;sym<symbol;sym++)
   {
      for(int TF=0;TF<10;TF++)
       {
         ⋮
       } // for
   } //sym
 
William Roeder:
for(…) enum{…} makes no sense. You can't execute a declaration.

What should i do to loop the timeframes ?

 
DroidM:

What should i do to loop the timeframes ?

  ENUM_TIMEFRAMES period[10]={PERIOD_M1,PERIOD_M2,PERIOD_M3,PERIOD_M4,PERIOD_M5,PERIOD_M6,PERIOD_M10,PERIOD_M12,PERIOD_M15,PERIOD_M20};
  int symbol= SymbolsTotal(1);
  for(int sym=0;sym<symbol;sym++)
   {
      for(int TF=0;TF<10;TF++)
       {
        //use period[TF] here to define timeframe and get your indicator (e.g. iRSI). 
        ⋮
       } // for
   } //sym
 
DroidM: What should i do to loop the timeframes ?

Go to bed. When you wake up, you will see that that question was already answered.

 
William Roeder:

Go to bed. When you wake up, you will see that that question was already answered.

You don't need to be a smartass about it
 
DroidM:
You don't need to be a smartass about it
Well, he did answer your question. It is just that it appears that you don't understand the answer.
 
WindmillMQL:
Well, he did answer your question. It is just that it appears that you don't understand the answer.
And here comes another one.
 
DroidM:
And here comes another one.
int period[10]={1,2,3,4,5,6,10,12,15,20};

Perhaps something like this...