PC Set global variables
This article was :
published
updated
On MetaTrader4 (MT4) / MetaTrader5 (MT5), you can set global variables, which are stored in MT4/MT5 itself independently of programs such as Expert Advisors (EA) and indicators. All programs running on MT4/MT5 can use the global variables.
Please note that these global variables set on MT4/MT5 are different from the usual global variables that are declared outside of functions in the source code of EA and indicators.
The global variables for MT4/MT5 are stored for 4 weeks from the last access to MT4/MT5. Note that they will be deleted after 4 weeks of no access.
Here we will look at how to set global variables on MT4/MT5.
Switch between MT4/MT5 tabs to check the steps for each.
Step 1
Click "Tools" in the menu and select "Global Variables".
Step 2
Add a global variable
To add a global variable, click "Add" and set the variable name and value.
Edit a global variable
To edit a global variable, double-click the item you wish to change and edit the variable name or value.
Delete a global variable
To delete a global variable, select the variable you wish to delete and click "Delete".
Step 1
Click "Tools" in the menu and select "Global Variables".
Step 2
Add a global variable
To add a global variable, click "Add" and set the variable name and value.
Edit a global variable
To edit a global variable, double-click the item you wish to change and edit the variable name or value.
Delete a global variable
To delete a global variable, select the variable you wish to delete and click "Delete".
Was this article helpful?
0 out of 0 people found this article helpful.
Thank you for your feedback.