Download MetaTrader 5

sort Market Watch window by Symbol name? - page 2

To add comments, please log in or register
capoeira
113
capoeira  

wow...people are ignorant on both sides

here is how it can be done, semi automatic, and therefore it can be done fully automatic also: http://forums.theforexguy.com/threads/how-to-easily-organise-mt4-market-watch-alphabetically.704/ 

Alain Verleyen
Moderator
29873
Alain Verleyen  
capoeira:

wow...people are ignorant on both sides

here is how it can be done, semi automatic, and therefore it can be done fully automatic also: http://forums.theforexguy.com/threads/how-to-easily-organise-mt4-market-watch-alphabetically.704/ 

Ok we are waiting your code for the full automation. Thank you.
schumeisterj
5
schumeisterj  

The arrogance of some of you people - mods included - is truely staggering

nicholishen
1547
nicholishen  

This is actually quite easy to do....

#property strict
#include <Arrays\ArrayString.mqh>
void OnStart()
{
   CArrayString list;
   for(int i=SymbolsTotal(true)-1;i>=0;i--)
   {
      list.Add(SymbolName(i,true));
      SymbolSelect(SymbolName(i,true),false);
   }
   list.Sort(); 
   Sleep(10);
   for(int i=0;i<list.Total();i++)
      SymbolSelect(list[i],true);         
}
whroeder1
17124
whroeder1  
Except that isn't what the OP asked. He asked how to sort the window, not a list.
Fernando Carreiro
3917
Fernando Carreiro  
whroeder1: Except that isn't what the OP asked. He asked how to sort the window, not a list.
Actually, that is exactly what it does - it sorts the symbols in the Market Watch, not just the list.
Fernando Carreiro
3917
Fernando Carreiro  
nicholishen: This is actually quite easy to do....

Thanks! There is however a little hiccup. It won't sort the currently selected chart/symbol (or the top one on the list, at least).

nicholishen
1547
nicholishen  
whroeder1 2017.11.10 07:15      EN

Except that isn't what the OP asked. He asked how to sort the window, not a list.


Fernando Carreiro:
Actually, that is exactly what it does - it sorts the symbols in the Market Watch, not just the list.

Fernando, don't feed the troll...


"Thanks! There is however a little hiccup. It won't sort the currently selected chart/symbol (or the top one on the list, at least)."

That's because SymbolSelect cannot deselect an open window...

Fernando Carreiro
3917
Fernando Carreiro  
nicholishen: That's because SymbolSelect cannot deselect an open window...

I suspected that was the reason, but just wanted to point out the "hiccup"! If only there was a way of running a script without any Charts Open!

However, one can always manually move the symbol in question to the correct place after running the script (or run it against the Chart of the known First symbol).

12
To add comments, please log in or register