Download MetaTrader 5
To add comments, please log in or register
Any problems with the code? Find solution in documentation!
madruga trader
47
madruga trader 2016.11.19 23:15 

hello,

 

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

 

thnks. 

Alain Verleyen
Moderator
28547
Alain Verleyen 2016.11.20 12:01  

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
47
madruga trader 2016.11.20 19:20  
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
8163
Mladen Rakic 2016.11.20 20:09  
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
47
madruga trader 2016.11.20 21:26  
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
47
madruga trader 2016.11.20 21:30  
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
47
madruga trader 2016.11.21 07:41  
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