How to know a symbol is a currency pair

 

and no CFD or future, etc. ?

In mql4 and mql5.

Anyone has an idea ?

Thank you

 
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...
 

Hello,

thank you for this link. I already checked all the SymbolInfoX, but there seems not to be some definite attribute.

However, 

SymbolInfoDouble(_Symbol,SYMBOL_TRADE_CONTRACT_SIZE)

works for me to identify forex on MT4,MT5. It returns 100.000.

 
chinaski:

Hello,

thank you for this link. I already checked all the SymbolInfoX, but there seems not to be some definite attribute.

However, 

works for me to identify forex on MT4,MT5. It returns 100.000.

https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_calc_mode

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...