MQL4参考 程序端全局变量 GlobalVariableTemp


The function attempts to create a temporary global variable. If the variable doesn't exist, the system creates a new temporary global variable.

bool  GlobalVariableTemp(
   string  name      // Global variable name



[in]  The name of a temporary global variable.

Return Value

If successful, the function returns true, otherwise - false. To get details about the error, you should call the GetLastError() function.


Temporary global variables exist only while the client terminal is running; after the terminal shutdown they are automatically deleted. Note that during the execution of GlobalVariablesFlush() temporary global variables are not written to a disk.

After a temporary global variable has been created, it can be accessed and modified the same as global variable of the client terminal.