MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Global variables  GlobalVariableSet

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
datetime GlobalVariableSet( string name, double value)
Sets a new value of the global variable. If it does not exist, the system creates a new gloabl variable. If the function succeeds, the returned value will be the last access time. Otherwise, the returned value will be 0. To get the detailed error information, one has to call the GetLastError() function.
Parameters:
name   -   Global variable name.
value   -   The new numeric value.
Sample:
  //---- try to set new value
  if(GlobalVariableSet("BarsTotal",Bars)==0)
    return(false);
  //---- continue processing