MQL4参考 程序端全局变量 GlobalVariablesDeleteAll


Deletes global variables of the client terminal.

int  GlobalVariablesDeleteAll(
   string     prefix_name=NULL,     // All global variables with names beginning with the prefix
   datetime   limit_data=0          // All global variables that were changed before this date



[in] Name prefix global variables to remove. If you specify a prefix NULL or empty string, then all variables that meet the data criterion will be deleted.


[in] Optional parameter. Date to select global variables by the time of their last modification. The function removes global variables, which were changed before this date. If the parameter is zero, then all variables that meet the first criterion (prefix) are deleted.

Return Value

The number of deleted variables.


If both options are equal to zero (prefix_name = NULL and limit_data = 0), then function deletes all global variables of the terminal. If both parameters are specified, then it deletes global variables corresponding to both parameters.

Global variables exist in the client terminal during 4 weeks since their last use, then they are automatically deleted.