How to get another EA data

 

Hello,

I have the same EA runing on multiple currancy pairs.

I need to get the highest calculated equity target price.

What is the best way to do that? what methode should I use?

 

Using only MQL you can do it with:

Using external dll's you can use any interprocess communication protocol you feel comfortable with.
Global Variables of the Terminal - MQL4 Reference
Global Variables of the Terminal - MQL4 Reference
  • docs.mql4.com
Global variables are kept in the client terminal for 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well. When testing and optimizing the Expert Advisors that use global variables, keep in mind...
 
Drazen Penic:

Using only MQL you can do it with:

Using external dll's you can use any interprocess communication protocol you feel comfortable with.

So How do I connect the 'equity target' value to 'GlobalVariableGet' or 'GlobalVariableSet'

I know this:

//+------------------------------------------------------------------+

//|  Global Variable Set                                             |

//+------------------------------------------------------------------+  

datetime GVSet(string name,double value)

{

   return(GlobalVariableSet(prefix+name,value));

}

//+------------------------------------------------------------------+

//|  Global Variable Get                                             |

//+------------------------------------------------------------------+

double GVGet(string name)

{

   return(GlobalVariableGet(prefix+name));

}



But how to insert the value to GVGet?

 

I'm not sure if get your requirements correctly, but as I see it your EA(s) that calculate equity target price(s) should create and update global variables using GlobalVariableSet().

Let's say you have some value calculated in your EA or indicator and you want to share it with other running EA's. 
When you calculate the value for e.g. EURUSD, we can save it in a global variable named for example "EURUSD_Some_Important_Value"

For example:

GlobalVariableSet("EURUSD_Some_Important_Value", 1.11001);


EA's that should read those calculated values will use GlobalVariableGet().
You can use GlobalVariableCheck() to make sure that the variable exists.

double someValue = GlobalVariableGet("EURUSD_Some_Important_Value");


Go to menu "Tools" -> "Global variables" or press F3 in Metatrader. You'll get better picture how global variables work. 
When you create a variable through code you'll see it in that form.

 
Lior Bercu:

Please edit your post and

use the code button (Alt+S) when pasting code