Download MetaTrader 5

communication between EAs - other then with global variables of the terminal ?

To add comments, please log in or register
Willbur
198
Willbur  
I wrote an EA who will support me in trading (e. g. traling Stops, buy and sell on trendlines and so on).

I apply this EA for each chart which I open.

How can these EA kommunizierien with each other ?

Is there an other way then using the global variables of the terminal?

         GlobalVariableGet () ...-Set().


Willbur
Marco vd Heijden
Moderator
5299
Marco vd Heijden  

yes

FileOpen();

and

FileWrite();

or use named pipes.

https://www.mql5.com/en/articles/503

Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
  • 2012.10.15
  • MetaQuotes Software Corp.
  • www.mql5.com
Many developers face the same problem - how to get to the trading terminal sandbox without using unsafe DLLs. One of the easiest and safest method is to use standard Named Pipes that work as normal file operations. They allow you to organize interprocessor client-server communication between programs. Take a look at practical examples in C++ and MQL5 that include server, client, data exchange between them and performance benchmark.
Willbur
198
Willbur  

"named pipes" sounds good.

I am going to try this one.

Thanks

     Willbur

Alain Verleyen
Moderator
32774
Alain Verleyen  
Willbur:

"named pipes" sounds good.

I am going to try this one.

Thanks

     Willbur

Using named pipes to communicate between code running on the same MT5 terminal is like using a rocket to crush a fly.

You can use Custom Events or files.

By the way, what is the problem with Global Variables ?

Marco vd Heijden
Moderator
5299
Marco vd Heijden  

Alain Verleyen:

 is like using a rocket to crush a fly.

At least that sounds like something that has a high success rate
Willbur
198
Willbur  
 
By the way, what is the problem with Global Variables ?

No problems so far.

I was afraid that I can't control whether the variables are always written to disk so that the other EA can read.

After reading the manual, writing on disk does not appear to be necessary.

Willbur

To add comments, please log in or register