- Mirroring trades to another MT4 on a same computer?
- Discussion on "How to write a DLL for MQL5 and exchange data in 10 minutes".
- Questions from a "dummy"
The simplest way I can think of that does not require DLL (so it can be used on MQL5 VPS), and allows communication between EAs even over the Internet, is to setup a very simple web message queue service, which can run either on the local machine, or on the local network or even on an internet server.
Then with the use of the WebRequest function you can simply interact with the web service to either send messages to the queue or retrieve messages from the queue.
There are many open source web message queue applications available on the internet, some very simple and others that are more complex. Research them to find one that suits your needs or simply code one yourself.
The simplest way I can think of that does not require DLL (so it can be used on MQL5 VPS), and allows communication between EAs even over the Internet, is to setup a very simple web message queue service, which can run either on the local machine, or on the local network or even on an internet server.
Then with the use of the WebRequest function you can simply interact with the web service to either send messages to the queue or retrieve messages from the queue.
There are many open source web message queue applications available on the internet, some very simple and others that are more complex. Research them to find one that suits your needs or simply code one yourself.
Thank you for the information, but that's not for me, because I need the fastest method and that only works with RAM :)
If both terminals are on the same machine, then use a small RAMDrive with a junction point in the Common directory and then use normal MQL File functionality that William has mentioned. DLL will probably be slower, because of the extra loading overhead, and uses more resources.
However, a simple memory based message queue running as a windows service on the local machine will be just as fast.
Another option is to use Named Pipes as they are stored in RAM as long as the message queue does not exceed its ram buffer size (probably around 64KB) at which point it will block.

- www.mql5.com
The following may also be of interest (a quote from someone else's post, see below):
"What you didn´t mention was plain memory blocks, which could be the best for your purpose, cause locking/unlocking is also implemented by Windows and it´s 3-4 times faster than memory mapped files. To deal with such buffers, take a look at the manuals of Microsoft. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-globalalloc. You can deal with this functions without the need of any additional DLLs, it can be done entirely in MQL. I use this too in such special environments and its just simple and faster than anything else."
Forum on trading, automated trading systems and testing trading strategies
Doerk Hilger, 2020.10.01 23:31
Hey,
I did lots of benchmarks with most of the types for data exchange that you mentioned. But its not only about about performance, safety is also very important, because you have to make sure, that there are not two or more processes which try to access and write a file at the same time. This is what you should definetly have in mind.
Let me give you some hints.
* MQL file access is not working with shared files, the functions are buggy, don´t use that at all (there is sample code in this forum which I created months ago to demonstrate that)
* Memory mapped files are cool and quick so far, but you have to handle the locking by yourself entirely
* DDE ... no experience in combination with MQL
* Named pipes ... you need a host to setup on, for your purpose probably a little too much overhead
What you didn´t mention was plain memory blocks, which could be the best for your purpose, cause locking/unlocking is also implemented by Windows and it´s 3-4 times faster than memory mapped files. To deal with such buffers, take a look at the manuals of Microsoft. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-globalalloc. You can deal with this functions without the need of any additional DLLs, it can be done entirely in MQL. I use this too in such special environments and its just simple and faster than anything else.
If both terminals are on the same machine, then use a small RAMDrive with a junction point in the Common directory and then use normal MQL File functionality that William has mentioned. DLL will probably be slower, because of the extra loading overhead, and uses more resources.
However, a simple memory based message queue running as a windows service on the local machine will be just as fast.
open the command line and enter “mklink /J «junctionName» «path\realDirectory»”

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use