Download MetaTrader 5
To add comments, please log in or register
Create interesting Forum topics concerning the automated trading!
Timerider
78
Timerider 2014.09.15 13:41 

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]);
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.09.15 15:20  
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.
Timerider
78
Timerider 2014.09.15 15:53  
Sorry. It says"x-undeclared identifier".
/
To add comments, please log in or register