possible to identify the currency in a pair?

 

hi all,

i want to do a currency strength type of EA

So, let's say i want to long EU

I want to see if euro part of the pair is in also long in EJ, EG 

so is it possible to automatically identify Eur in the EU on my chart and then find the euro direction from EJ, EG ?

hope you understand my question

 
bobo1974:
...

hope you understand my question

Do you ?
 
Alain Verleyen:
Do you ?

lol

ok let me rephrase

let's say the chart i have the EA on is EURUSD. It is now giving me a signal to long

I want confirmation from other pairs that EUR is long as long. Eg if EURJPY and EURGBP also says long, then only i will take long position in EURUSD

now the issue is this. I don't want to create an EA for EURUSD. another EA for USDCAD, etc

I would like to have a single EA that can

 

1) detect the 1st currency in the chart is EUR (because it is a EURUSD chart)

2) look in my codes for other pairs which has EUR as its 1st currency (or for some as 2nd currency in the pair)

 

the rest of the codes, i will gather the buy/sell signal based on what the EUR in all those pairs tell me 

 
maybe try with StringSubstr(Symbol(), 0, 3)
 
bobo1974:
...

1) detect the 1st currency in the chart is EUR (because it is a EURUSD chart)

2) look in my codes for other pairs which has EUR as its 1st currency (or for some as 2nd currency in the pair)

...

SymbolInfoString()

SYMBOL_CURRENCY_BASE

Basic currency of a symbol

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

 
ah nice to know :)
 
Alain Verleyen:

SymbolInfoString()

SYMBOL_CURRENCY_BASE

Basic currency of a symbol

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

nice

thank you 

 
Alain Verleyen:

SymbolInfoString()

SYMBOL_CURRENCY_BASE

Basic currency of a symbol

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

for EURUSD, is EUR the base and USD the profit currency?
 
bobo1974:
for EURUSD, is EUR the base and USD the profit currency?
Too much questions...try it and you will see.
 
Alain Verleyen:
Too much questions...try it and you will see.

will try thx

edit : thank you. i found the answer 

 
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING. Some symbols...
Reason: