Download MetaTrader 5

Determine Symbols Market

To add comments, please log in or register
Taskin Osman
816
Taskin Osman  

Hi,

 

i would like to determine if a given symbol is a forex or non forex symbol. Any suggestions?

 

void UpdateSymbolData()
{
  
  int Now=(int)TimeCurrent();
  for (int i=0;i<SymbolsTotal(false);i++) 
   {
   string S=SymbolName(i,false);
   double D=MarketInfo(S,MODE_DIGITS); 
   double TickValue = MarketInfo(S,MODE_TICKVALUE);  
   ......mycode.....
   } 
}

 

I am using SymbolsTotal and SymbolName, i have checked SymbolInfoString and similar but could not find a way to determine.

Can somenoe help me please?

tx

Keith Watford
Moderator
9641
Keith Watford  

You could try

if(MarketInfo(S,MODE_PROFITCALCMODE)==0)
  {
   //is forex
  }
To add comments, please log in or register