Getting list of symbols in Market Watch window - Giving back

 

Well, thanks to the latest builds (600+) of MT4, we can now easily get this information.

Here's the code:

void OnStart()
  {
//---
   int HowManySymbols=SymbolsTotal(true);
   string ListSymbols=" ";
   for(int i=0;i<HowManySymbols;i++)
     {
      ListSymbols=StringConcatenate(ListSymbols,SymbolName(i,true),"\n");
     }
   Comment(ListSymbols);
   Alert(HowManySymbols);
  }

 The code on it's own just lists out whats available in the Market Watch window and then issues an alert to tell you how many there are.  But from this code, you should be able to easily incorporate this into your code.

 

more than 6 years later but hey ...

thank you so much. mql4 beginner here .

those lines above help me fix the issue I was grappling with for 4 days .

thank you for giving back.