Download MetaTrader 5

Where to get the list of all trading pairs?

To add comments, please log in or register
All articles are available from MetaTrader 5. Contribute your own one!
sumustinis
7
sumustinis 2013.02.27 15:37 

Hi there,

I would like to get a list of all trading pairs aka Symbol via loop. But can`t find more info about how this pairs is stored ... For example the result of SymbolName function. But struggling to find the information what data structure or type I should iterate to achieve this. For example to get time frames I could iterate the enum TIME_FRAMES. Hope the question is clear :)

Documentation on MQL5: Market Info / SymbolName
Documentation on MQL5: Market Info / SymbolName
  • www.mql5.com
Market Info / SymbolName - Documentation on MQL5
chinaski
890
chinaski 2013.02.27 17:03  

Hello,

-use the following functions:

int SymbolsTotal(
bool selected // True - only symbols in MarketWatch

);

-cycle over number and for each index call 

string SymbolName(
int pos, // number in the list
bool selected // true - only symbols in MarketWatch

); 

 

If you need information about symbol call 

 

SymbolInfoInteger,SymbolInfoDouble,SymbolInfoString
To add comments, please log in or register