Download MetaTrader 5
To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
Ernest Klokow
1082
Ernest Klokow 2014.04.17 15:01 

If you declared AND initialize some Global and Local Variables, are these variables re-initialized after every cycle reaches return(0) or does it go back to Start() and skips the re-initialization of the variables?

My own opinion is that it does not re-initialize the variables on every cycle - but is that correct?

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.17 15:12  
Yes. Initialization is like a starting point. After that, start() will take over. However, if you want to re-initialized, it is possible though. With some codings of course.
Carl Schreiber
6392
Carl Schreiber 2014.04.17 16:22  
ernest02:

If you declared AND initialize some Global and Local Variables, are these variables re-initialized after every cycle reaches return(0) or does it go back to Start() and skips the re-initialization of the variables?

My own opinion is that it does not re-initialize the variables on every cycle - but is that correct?


.. it depends.

Please provide a code example for a serious answer.

Ian Venner
2583
Ian Venner 2014.04.18 03:53  

Initialization of global and static variables is performed once. Initialization of local variables is made every time their function is called.

/
To add comments, please log in or register