Check if symbol exists

To add comments, please log in or register
Dua Yong Rew
5526
Dua Yong Rew  

Hi,

Any functions that can check if symbol exists for trading? 

Alain Verleyen
37485
Alain Verleyen  
doshur:

Hi,

Any functions that can check if symbol exists for trading? 

SymbolSelect()
Dua Yong Rew
5526
Dua Yong Rew  
angevoyageur:
SymbolSelect()
thanks
Ivan Petkow
171
Ivan Petkow  

Not yet mentioned in the MQL Reference, but 'SymbolExist' is already highlighted as a valid Keyword in the MetaEditor (build 1970)

bool SymbolExist(const string symbol_name, bool &is_custom)

ycomp
321
ycomp  

sounds a bit extreme to select a symbol just to verify it exists...


void OnStart()

  {

//---


Print(IsSymbol("EURUSD"));

Print(IsSymbol("I Ain't No Symbol, Biyatch!"));

   

  }

//+------------------------------------------------------------------+


bool IsSymbol(string symbol) {

    SymbolInfoDouble(symbol, SYMBOL_BID);

    return GetLastError() != ERR_MARKET_UNKNOWN_SYMBOL;

}

To add comments, please log in or register