Currencies List

 

I want to populate an array of strings with the names of the all the currencies/indexes/cfd/metals which are available at a dealer.

Anyone know how to get this in code?

 
I don't know to get the whole list, including index, cfd, and metals. But I can get the whole list for all major pairs by creating every combination of all pairs.
There are 8 major currencies, so there are 56 combination (or 28 if the algorithm is clever enough to remove redundant combination).
For each combination I test it using MarketInfo(). If I get a meaningful return value, e.g. non zero spread, then the pair is available.

Of course if anybody has a better solution, I'm all ears also.
 

Since the available securities are dependent on which dealer you are attached to,
it should be possible to discover what they are.

The terminal does it, else it could not display them in MarketWatch.

So...

 
Yes the list is there in the terminal, but there is no access to such info is given thru MQL.
Probably this should be in the wishlist for metaquotes for future enhancement?
 
Such theme was in russian forum.
Solution - sort out ready list. Use this library: 'SymbolLister'
 
Yes it is an implementation of the algorithm I describe above, without removing redundant combination but use more comprehensive list of currencies.
But I'd like also a complete list, as prefered by phy. A list contains indexes, cfd, and more metals than just XAU and XAG.
 
fireflies:
I don't know to get the whole list, including index, cfd, and metals. But I can get the whole list for all major pairs by creating every combination of all pairs.
There are 8 major currencies, so there are 56 combination (or 28 if the algorithm is clever enough to remove redundant combination).
For each combination I test it using MarketInfo(). If I get a meaningful return value, e.g. non zero spread, then the pair is available.

Of course if anybody has a better solution, I'm all ears also.
There are now new pairs offered by various brokers. ODL, for example, offers EURTRY, USDTRY, TRYJPY, USDZAR, ZARJPY and USDNOK.

This makes the need for a market lister even more urgent.
 
I've made some custom with adding new (if it's not some type linux'es which does not have input allowed option by wine).
Part for putting in array.
Reason: