Simple Problem with arrays

 

Hello,

Ive got a little Problem with the mql4 array funktion. I want to open a chart with the ChartOpen() funktion in different timeframes . To make it easy, Iv set up an array with all the different timeframes. Then, Ive inserted it into the ChartOpen() funktion, like int the Article: ,,Mql4 for newbies Part 2". But it didn´t work. It always says: ,,x - is not declared". So here my question: How can I open a chart in different timeframes without writing the ChartOpen() funktion again and again. Thanks for your answers!!

int period[]={1,5,15,30,60,240,1440,10080,43200};
ChartOpen("EURUSD",period[x]);
 
x - is not declared
Then, why don't you declare it ? If you ask how to declare, you are not even cover the basics here and you want to use array straight away.
 
Sorry. It says"x-undeclared identifier".
Reason: