Using only MQL you can do it with:

- docs.mql4.com
Using only MQL you can do it 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.
Please edit your post and
use the code button (Alt+S) when pasting code

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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?