'+' - variable expected

 
ArrayResize("ZZ_M1,symbolCount);
ArrayResize("ZZ_M2",symbolCount);
.....

For ArrayResize I want to write it with for loop

int timeframes[11]= {1,2,3,4,5,6,10,12,15,20,30};
   for(int i=0; i<11; i++) {
      ArrayResize("ZZ_M"+timeframes[i],symbolCount);
   }

just to replace M1, M2, ... timeframes using for loop

but error is

'+' - variable expected 

What i am doing wrong?

 
Arpit Tailang:

For ArrayResize I want to write it with for loop

just to replace M1, M2, ... timeframes using for loop

but error is

What i am doing wrong?

https://www.mql5.com/en/docs/array/arrayresize

Does not receive a string as first parameter, you can't concatenate strings and generate reference to variables.
You either will need a multidimensional array or do it manually:

ArrayResize(ZZ_M1, symbolCount);
ArrayResize(ZZ_M2, symbolCount);
ArrayResize(ZZ_M3, symbolCount);
...
Documentation on MQL5: Array Functions / ArrayResize
Documentation on MQL5: Array Functions / ArrayResize
  • www.mql5.com
ArrayResize - Array Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Alexandre Borela #:

https://www.mql5.com/en/docs/array/arrayresize

Does not receive a string as first parameter, you can't concatenate strings and generate reference to variables.
You either will need a multidimensional array or do it manually:

thanks