[Indicator] Where the best place to put the global variables? Inside init(){...} or outside the function??
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.
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.
If they are declared inside a function they are local to the function, not global.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.