Download MetaTrader 5

Are global variables accessed atomically?

To add comments, please log in or register
Publish your application in Cobe Base. Millions of traders will see it!
Guillermo
95
Guillermo 2016.07.26 11:31 

Hello,

My EA will have various instances running on different pairs. Once a day, I would like to check the existence of new files in some directory. If they exist, I would like to relaunch all the instances, but just once.

I was thinking to implement it using global variables, however, from the documentation, they seem not to grant atomic access. How could I achieve it?

Best regards.

rod178
273
rod178 2016.07.26 12:51  
Drazen Penic
2545
Drazen Penic 2016.07.26 13:00  

Use GlobalVariableSetOnCondition()

Excerpt from the documentation:

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. 

To add comments, please log in or register