Download MetaTrader 5
To add comments, please log in or register
Find out how social trading can improve your profits
Ernest Klokow
1069
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
5951
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