TradeMUX SDK Documentation  1.0
TradeMUX SDK Documentation
bool GlobalVariableSetOnCondition ( string  name,
double  value,
double  check_value 
)

Sets the new value of the existing global variable if the current value equals to the third parameter check_value.
If there is no global variable, the function will generate an error ERR_GLOBALVARIABLE_NOT_FOUND (4501) and return false.

Parameters
nameGlobal variable name
valueNew value
check_valueThe value to check the current value of the global variable
Returns
If successful, the function returns true, otherwise it returns false. For details about the error call GetLastError().
If the current value of the global variable is different from check_value, the function returns false

Function provides atomic access to the global variable, so it can be used for providing of a mutex at interaction
of several Expert Advisors working simultaneously within one client terminal