- void onStart()
- {//---
- string pairs[];
- int length = getAvailableCurrencyPairs(pairs);
- for(int i=0; i < length; i++)
- { alert("Pair #", i+1, ": ", pairs[i]); }
- }//+------------------------------------------------------------------+
- int getAvailableCurrencyPairs(string& availableCurrencyPairs[])
- {//---
- bool selected = false;
- const int symbolsCount = SymbolsTotal(selected);
- int currencypairsCount;
- ArrayResize(availableCurrencyPairs, symbolsCount);
- int idxCurrencyPair = 0;
- for(int idxSymbol = 0; idxSymbol < symbolsCount; idxSymbol++)
- {
- string symbol = SymbolName(idxSymbol, selected);
- string firstChar = StringSubstr(symbol, 0, 1);
- if(firstChar != "#" && StringLen(symbol) == 6)
- {
- availableCurrencyPairs[idxCurrencyPair++] = symbol;
- }
- }
- currencypairsCount = idxCurrencyPair;
- ArrayResize(availableCurrencyPairs, currencypairsCount);
- return currencypairsCount;
- }
|