Download MetaTrader 5
To add comments, please log in or register
Launch your trading signal. Make profit from paid subscription!
Musngi
281
Musngi 2016.10.14 14:11 

Where the best place to put the global variables? Inside init(){...} or outside the function?? My variables will used in many functions repeatedly. 

I want to know the best way and efficiently to create indicator. 

whroeder1
13656
whroeder1 2016.10.14 17:57  
If they are declared inside a function they are local to the function, not global.
Musngi
281
Musngi 2016.10.14 18:55  
WHRoeder:
If they are declared inside a function they are local to the function, not global.
init() function is initialization, it sounds like global to me. I tried to put global variable in init() function but MQL gave me a warning. 
Keith Watford
Moderator
8028
Keith Watford 2016.10.14 21:22  
Musngi:
init() function is initialization, it sounds like global to me. I tried to put global variable in init() function but MQL gave me a warning. 
WHRoeder:
If they are declared inside a function they are local to the function, not global.
/
To add comments, please log in or register