Download MetaTrader 5

Getting list of symbols in Market Watch window - Giving back

To add comments, please log in or register
Michael
703
Michael  

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.

To add comments, please log in or register