The Java application is refreshing the txt-file about 10-20 times per second and copying it to MT4-data-folder. If the MT4 EA is not running, this process is working absolutely fine.
However when the MT4 EA starts reading the txt-file (using FILE_SHARED_READ), it seems the txt-file cannot be modified/refreshed any more by the Java application.
The Java application is refreshing the txt-file about 10-20 times per second and copying it to MT4-data-folder. If the MT4 EA is not running, this process is working absolutely fine.
However when the MT4 EA starts reading the txt-file (using FILE_SHARED_READ), it seems the txt-file cannot be modified/refreshed any more by the Java application.
Maybe you can use a shared token so that only one out of both can handle the file at a time.
like check read done check write done etc. to sync them in a bidirectional fashion.
Or you can use already present unidirectional communication like pipes.
Please see CNamedPipes class CNamedPipes.mqh

- 2010.07.01
- investeo
- www.mql5.com
The Java application is refreshing the txt-file about 10-20 times per second and copying it to MT4-data-folder. If the MT4 EA is not running, this process is working absolutely fine.
However when the MT4 EA starts reading the txt-file (using FILE_SHARED_READ), it seems the txt-file cannot be modified/refreshed any more by the Java application.
Thanks for the replies. I will take a look at the named pipes solution.
@honest_knave: Of course using both. Without FILE_READ it is not working at all.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to send data (values of 5 string-variables) from my Java application to my MT4 EA.
I have tried this by making the Java application write to a txt-file and copying the file to MT4-data-folder and an EA accessing the txt-file using FILE_SHARED_READ, however this was not working.
Does anybody know a better way to send data/text from a Java application to an MT4 EA? Thanks in advance!