what is the good way to detect if a symbol is existing?

 

What is the good way to detect if a symbol is existing? 

E.g. How to detect if "EurUsd.Pro" is existing or not? 

 
for loop SymbolsTotal() compare with SymbolName()
 
qjol:
for loop SymbolsTotal() compare with SymbolName()

Yes, a good idea, thanks! 

 
MqlTick tick;
SymbolInfoTick(sym,tick);
if(GetLastError()==4106)
  {
   Print(sym+" is not available");
  }
Attempt to retrieve something. If the last error is 4106, the symbol doesn't exist.
 
jollydragon:

What is the good way to detect if a symbol is existing? 

E.g. How to detect if "EurUsd.Pro" is existing or not? 

 

     string symbol="EurUsd.Pro";

     if(SymbolInfoInteger(symbol,SYMBOL_SELECT)) Print(symbol,"   found") ;

     else Print(symbol,"   not found");  
Reason: