Data exchange between 2 MT4 terminals over the internet

To add comments, please log in or register
Marcin Madrzak
471
Marcin Madrzak  
I have the following problem to solve. On computer A, there is an EA that updates several variables several times a day. On computer B there is EA, which must read these values ​​when they change. Both computers are in different locations and communication between them can only take place via the Internet. I am looking for a simple and effective way to exchange data for the assumptions described above.
I am considering:
1. saving data in the form of pending orders - simple but inelegant and causes a mess in the account history
2. saving data to a file and its synchronization using one of the popular cloud storage solutions - because files can be saved only in the sandbox, you probably need to use some symbolic links
3. write data to a remote web server and download them using the web service - because I can not code in another language other than MQL, I would probably have to hire someone to write such simple web services for me - or are there ready-made solutions of this type?
4. saving data to a web server installed on computer A in the form of a txt file and reading by WebRequest on computer B - I have the impression that somewhere I have already seen a mention of a similar solution in mql but I can not find it
5. using a queue, e.g. ZeroMQ which has libraries for mql, but I do not know if this is not overkill for the rare exchange of such a small amount of data
Maybe someone has a different idea or came across some other solution earlier? Any ideas are welcome :)
Marco vd Heijden
Moderator
12688
Marco vd Heijden  

You can just share the folder with the file you wrote to on a small lightweight webserver and directly load it in the other terminal.

Marcin Madrzak
471
Marcin Madrzak  
Marco vd Heijden:

You can just share the folder with the file you wrote to on a small lightweight webserver and directly load it in the other terminal.

I have no experience with web servers. I understand that first I need to install some lightweight webserver like mongoose, share the file/folder and read the file with WebRequest() (or other way?) from the other computer, right?

nicholi shen
2392
nicholi shen  
Marcin Madrzak:

I have no experience with web servers. I understand that first I need to install some lightweight webserver like mongoose, share the file/folder and read the file with WebRequest() (or other way?) from the other computer, right?

Running a webserver sounds like the easy solution on the surface, but IMO it's probably one of the more difficult solutions because you'll need to either (A) open a port through your firewall and expose your windows machine to the internet (LOL-NOPE) or (B) you'd need to confine your webserver to your private network and implement a site to site VPN. Your best bet is to use an intermediate secured cloud server. For example you could run both terminals in portable mode from the same dropbox folder or you could use Webrequests to pass messages via an API like telegram or slack... or even roll your own API...

Marcin Madrzak
471
Marcin Madrzak  
nicholi shen:

Running a webserver sounds like the easy solution on the surface, but IMO it's probably one of the more difficult solutions because you'll need to either (A) open a port through your firewall and expose your windows machine to the internet (LOL-NOPE) or (B) you'd need to confine your webserver to your private network and implement a site to site VPN. Your best bet is to use an intermediate secured cloud server. For example you could run both terminals in portable mode from the same dropbox folder or you could use Webrequests to pass messages via an API like telegram or slack... or even roll your own API...

Similar doubts about security went through my mind. The API Telegram service has already been integrated in my EA for alerting, but I did not think to use it for data transfer till now. I see that the Telegram library I use has methods to listen to incoming messages so tomorrow I will take a closer look at this feature. Thank you for the tip.

To add comments, please log in or register