Multi-Currency Test Error: No prices for symbol EURUSD. SymbolName, SymbolSelect bugs??

 

When using code block with SymbolName() and SymbolSelect() functions, and subsequently calling for market data with the SymbolInfoDouble command, I get the error "No prices for symbol EURUSD."

When I don't call the for() loop, I'm able to retrieve market info via SymbolInfoDouble() and SymbolInfoInt() functions and the rest of the code works properly.  

I have been careful to use "false" in SymbolName(i,false), and "true" in SymbolSelect(symname,true), to make sure I'm not calling from only selected symbols and that I'm not "removing" any symbols from market watch during my operations.  I don't want to add or remove symbols from market watch— I just want to get a listing of ALL available symbols and put their names into a string array.  Can someone show me what I'm doing wrong, if anything?

 I believe a similar thread here (https://www.mql5.com/en/forum/1887) describes the same issue, but I don't think there has been a resolution yet.  Is someone at MetaQuotes looking into this, or am I doing something wrong here?

 

   static string symbolNames[999];

   int symtot = SymbolsTotal(false);

   for(int i=0;i<symtot;i++)

         {

            string symname = SymbolName(i,false);

            SymbolSelect(symname,true);

            symbolNames[i] = symname;

            Print("symbolNames[",i,"] = ", symbolNames[i]);

         }

double ConversionBid = SymbolInfoDouble(EURUSD,SYMBOL_BID);

double ConversionAsk = SymbolInfoDouble(EURUSD,SYMBOL_ASK);

double ConversionPoint = SymbolInfoDouble(EURUSD,SYMBOL_POINT);

int ConversionDigits = SymbolInfoInteger(EURUSD,SYMBOL_DIGITS);

int ConversionSpread = SymbolInfoInteger(EURUSD,SYMBOL_SPREAD);

 
&lt;&gt; error for dummies. Get your copy here!
  • www.mql5.com
Make sure you have all symbols activated: right click in Market Watch, then point to "Show all".
 
TheIdealTrade:

When using code block with SymbolName() and SymbolSelect() functions, and subsequently calling for market data with the SymbolInfoDouble command, I get the error "No prices for symbol EURUSD."

When I don't call the for() loop, I'm able to retrieve market info via SymbolInfoDouble() and SymbolInfoInt() functions and the rest of the code works properly.  

I have been careful to use "false" in SymbolName(i,false), and "true" in SymbolSelect(symname,true), to make sure I'm not calling from only selected symbols and that I'm not "removing" any symbols from market watch during my operations.  I don't want to add or remove symbols from market watch— I just want to get a listing of ALL available symbols and put their names into a string array.  Can someone show me what I'm doing wrong, if anything?

 I believe a similar thread here (https://www.mql5.com/en/forum/1887) describes the same issue, but I don't think there has been a resolution yet.  Is someone at MetaQuotes looking into this, or am I doing something wrong here?

 

Maybe you also need to use SymbolIsSynchronized (https://www.mql5.com/en/docs/marketinformation/symbolissynchronized) and in case when data is missing refresh it? (https://www.mql5.com/en/docs/series/timeseries_access)
Documentation on MQL5: Market Info / SymbolIsSynchronized
  • www.mql5.com
Market Info / SymbolIsSynchronized - Documentation on MQL5
Reason: