Download MetaTrader 5

script sample code to loop trough all symbols to lookup for number of daily trades.

To add comments, please log in or register
madruga trader
66
madruga trader  

hello,

 

i would like a script sample code to loop trough all symbols to lookup for number of daily trades. 

 

thnks. 

Alain Verleyen
Moderator
33504
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies


Welcome,

  • Usually people who can't code don't receive free help on this forum, though it could happen if you are lucky, be patient.
  • If you show your attempts and describe well your problem, you will most probably receive an answer from the community.
  • If you don't want to learn to code, nothing bad, you can either look at the Codebase if something free already exists, or in the Market for paid products (sometimes free also).
  • Finally, you also have the option to hire a programmer in the Freelance section.

Good luck.


madruga trader
66
madruga trader  
Alain Verleyen:

i can code... i just want the function that return me an array of all symbols or filtered by a search criteria.

 then i can loop trough it  to find wich one have a good number of trades.

i know metatrader has a lot of issues when loading symbols that are not loaded on the screen.

Mladen Rakic
63001
Mladen Rakic  
livetraderbr:

i can code... i just want the function that return me an array of all symbols or filtered by a search criteria.

 then i can loop trough it  to find wich one have a good number of trades.

i know metatrader has a lot of issues when loading symbols that are not loaded on the screen.

   string symbolNames[];
   bool   onlyInMarketWatch=true;
   int    size = SymbolsTotal(onlyInMarketWatch); ArrayResize(symbolNames,size);
         for (int i=0; i<size; i++)
            symbolNames[i] = SymbolName(i,onlyInMarketWatch);
Change the onlyInMarketWatch to false to get the symbols not shown in the market watch too
madruga trader
66
madruga trader  
Mladen Rakic:
   string symbolNames[];
   bool   onlyInMarketWatch=true;
   int    size = SymbolsTotal(onlyInMarketWatch); ArrayResize(symbolNames,size);
         for (int i=0; i<size; i++)
            symbolNames[i] = SymbolName(i,onlyInMarketWatch);
Change the onlyInMarketWatch to false to get the symbols not shown in the market watch too

thanks for the answer !!!

 

the size array number is correct but the symbolname is always returning null. do you know why ? 

madruga trader
66
madruga trader  
livetraderbr:

thanks for the answer !!!

 

the size array number is correct but the symbolname is always returning null. do you know why ? 

ive made a mistake !!!

 thank you very much for the help !!! 

madruga trader
66
madruga trader  
ive got in trouble by sorting alphabetically the returning arra generated.

because i generated a string the the SYMBOL_PATH + SYMBOL_DESCRIPTION

the arraysort function seems to work only with numbers
To add comments, please log in or register