Sahred file writing between 2 or more EA from different brokers

 

Hi guys I'm trying to write an Array to a file using FileWriteArray() but I need to make this file shared writing between 2 or more EA from different brokers.

The fact is: if I use FILE_WRITE everything is ok. But when I use FILE_SHARE_WRITE I don't get my array written (the file remain empty)

P.S. why do I get a 5004 error if the file exist before i attach my EA to the chart?

This is the code I am using:



handle=FileOpen(NomeFile,FILE_BIN|FILE_WRITE|FILE_COMMON);
...
Action[0]=...;
Action[1]=...;
 FileWriteArray(handle,Action);
...
 FileClose(handle);
 
have you tried FILE_READ | FILE_WRITE | FILE_SHARE_READ | FILE_SHARE_WRITE ?
 
qjol:
have you tried FILE_READ | FILE_WRITE | FILE_SHARE_READ | FILE_SHARE_WRITE ?

Well, it worked. Thanks a lot
Reason: