Scripts: Clean Market Watch - Removes All Symbols In the Market Watch Windows In One Go

 

Clean Market Watch - Removes All Symbols In the Market Watch Windows In One Go:

The Clean Market Watch script is a simple utility tool designed to quickly remove all symbols from your MetaTrader 5 Market Watch window with a single click. This is particularly useful when you want to start fresh with a clean workspace or when your Market Watch has become cluttered with too many symbols. Purpose Over time, traders often accumulate numerous symbols in their Market Watch window, making it difficult to focus on the instruments they actively trade. Manually removing symbols one by one can be tedious and time-consuming. This script automates the entire process, clearing all symbols in seconds.

Clean Market Watch -  Removes All Symbols In the Market Watch Windows In One Go

Author: Hieronymos Junior Starch

 
Or just right click in the Market Watch window and Hide All. 😉
 
Ryan L Johnson #:
Or just right click in the Market Watch window and Hide All. 😉
If That always worked i wouldn't Have created this script. You may have not encountered it yet , but when You start working with increasingly more advanced custom symbols the Hide All feature breaks down real fast.
 
Hieronymos Junior Starch #:
You may have not encountered it...

This is true. I work with advanced custom symbols but nowhere near 523.

The fact that you've discovered a bug in your Market Watch window surprises me because the maximum number of Market Watch symbols in MT5 is 5000.

Market Watch - Trading Operations - MetaTrader 5 Help
Market Watch - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
The Market Watch window provides an overview of price data of financial instruments: quotes, price statistics and tick chart. It also provides...
 
Hieronymos Junior Starch #:
If That always worked i wouldn't Have created this script. You may have not encountered it yet , but when You start working with increasingly more advanced custom symbols the Hide All feature breaks down real fast.
Can you say how to reproduce this wrong behaviour ?
 
Alain Verleyen #:
Can you say how to reproduce this wrong behaviour ?
I think that it can be deduced from the OP's chart image--add 523 custom symbols to your Market Watch window.
 
Alain Verleyen #:
Can you say how to reproduce this wrong behaviour ?
To be Honest I haven’t Really Been able to Pin Down The Exact Cause of The Error.  
However I’ve noticed That once I create a custom Symbol. Sometimes it refuses to be removed from market watch window. Sometimes it can be removed normally but when it comes to that all symbols section there it’s persistent and cannot be removed, I had to go to the Terminals files and delete them manually.  
As You can Imagine this became annoying fast as sometimes the custom symbol might not work if it was calculated incorrectly and I intended to iterate fast.
After messing around  I noticed that when I removed the symbols with a script they would be be removed as intended most of the 99% of the time. 
Eventually realizing I might not be alone as some of the custom symbols that were persistent were not coded by me I decided to just make my solution public. 
(Since the script works almost all the time , I decided not to rack my brain any further)
 
Ryan L Johnson #:

This is true. I work with advanced custom symbols but nowhere near 523.

The fact that you've discovered a bug in your Market Watch window surprises me because the maximum number of Market Watch symbols in MT5 is 5000.

And as for 5000 I’m not so sure about that One. 
After 1000 symbols it either stops, the Symbols don’t finish loading, The terminal gets buggy or it just crashes although rare. It usually just stops adding symbols. 
I do speculate that adding symbols manually or with a script vs clicking on show all may behave differently in terms of how the symbols are loaded there. 
 
Hieronymos Junior Starch #:
To be Honest I haven’t Really Been able to Pin Down The Exact Cause of The Error.  
However I’ve noticed That once I create a custom Symbol. Sometimes it refuses to be removed from market watch window. Sometimes it can be removed normally but when it comes to that all symbols section there it’s persistent and cannot be removed, I had to go to the Terminals files and delete them manually.  
As You can Imagine this became annoying fast as sometimes the custom symbol might not work if it was calculated incorrectly and I intended to iterate fast.
After messing around  I noticed that when I removed the symbols with a script they would be be removed as intended most of the 99% of the time. 
Eventually realizing I might not be alone as some of the custom symbols that were persistent were not coded by me I decided to just make my solution public. 
(Since the script works almost all the time , I decided not to rack my brain any further)

The only time that I'm not able to hide a symbol in the Market Watch window is while my corresponding custom chart generating EA is still running on the source chart. Just like standard symbols, the custom symbol can't be hidden while in use.

If I want to generate the custom chart anew from scratch, I also delete its symbol from the Symbols==>Specification list.

 
Ryan L Johnson #:

The only time that I'm not able to hide a symbol in the Market Watch window is while my corresponding custom chart generating EA is still running on the source chart. Just like standard symbols, the custom symbol can't be hidden while in use.

If I want to generate the custom chart anew from scratch, I also delete its symbol from the Symbols==>Specification list.

That’s the normal behaviour of MT5 , what happens here is a different from that. Even when you only have the marketplace open or completely nothing, they still won’t come off. 
One day you will encounter it remember this script and you might come back knowing what causes it.
 
Hieronymos Junior Starch #:
[O]nce I create a custom Symbol. Sometimes it refuses to be removed from market watch window.

I have to say that I've been using some forms of MetaTrader, offline charts, and/or custom charts since about 2011--and I've never experienced your issue with one custom chart nor more. I visit this Forum daily, and I haven't heard of your issue before.

I do know, however, that MT5 behaves differently depending on operating system and system resources--especially under a heavy load.