SymbolLister
Download scriptThis script is designed to automatically identify and organize available trading pairs within your trading platform. Instead of requiring you to manually search for every possible currency combination, the tool handles this heavy lifting by scanning the underlying market data.
How it Works
The logic follows a systematic three-step process:
1. The Reference Database The script begins with an extensive internal list of global currency codes (such as USD, EUR, GBP, JPY, etc.). This serves as the "master list" of all possible building blocks for trading pairs.
2. Systematic Pairing To find out what you can actually trade, the script performs a comprehensive cross-comparison. It takes every currency in its database and pairs it with every other currency on that same list. Essentially, it simulates every possible combination (e.g., pairing "USD" with "EUR", then "USD" with "GBP", "USD" with "JPY", and so on).
3. Real-Time Market Verification This is the most important part of the logic: the script doesn't just assume every pair exists. As it generates these combinations, it immediately "pings" the market to see if that specific pair is actually active and tradable.
- If a pair (like EUR/USD) is available in your current market, the script adds it to its verified list.
- If a pair is not offered by your broker, the script ignores it and moves to the next one.
The Final Result
Once the process is complete, the script provides you with a clean, organized collection of every tradable symbol available to you. It filters out all the "noise" of impossible combinations, leaving you with only the functional assets you can use for trading.
//+------------------------------------------------------------------+
//| SymbolLister.mq4 |
//| Øóìàõåð |
//+------------------------------------------------------------------+
#property copyright "Øóìàõåð"
#property library
//----
string Currencies[] = {"AED", "AUD", "BHD", "BRL", "CAD", "CHF", "CNY",
"CYP", "CZK", "DKK", "DZD", "EEK", "EGP", "EUR",
"GBP", "HKD", "HRK", "HUF", "IDR", "ILS", "INR",
"IQD", "IRR", "ISK", "JOD", "JPY", "KRW", "KWD",
"LBP", "LTL", "LVL", "LYD", "MAD", "MXN", "MYR",
"NOK", "NZD", "OMR", "PHP", "PLN", "QAR", "RON",
"RUB", "SAR", "SEK", "SGD", "SKK", "SYP", "THB",
"TND", "TRY", "TWD", "USD", "VEB", "XAG", "XAU",
"YER", "ZAR"};
string Symbols[];
int SymbolCount = 0;
//+------------------------------------------------------------------+
//| ÑÎÇÄÀ¨Ò ÑÏÈÑÎÊ ÄÎÑÒÓÏÍÛÕ ÂÀËÞÒÍÛÕ ÑÈÌÂÎËΠ|
//+------------------------------------------------------------------+
int CreateSymbolList()
{
int CurrencyCount = ArrayRange(Currencies, 0);
int Loop, SubLoop;
string TempSymbol;
for(Loop = 0; Loop < CurrencyCount; Loop++)
for(SubLoop = 0; SubLoop < CurrencyCount; SubLoop++)
{
TempSymbol = Currencies[Loop] + Currencies[SubLoop];
if(MarketInfo(TempSymbol, MODE_BID) > 0)
{
ArrayResize(Symbols, SymbolCount + 1);
Symbols[SymbolCount] = TempSymbol;
SymbolCount++;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments