s_WaveMarker_DeleteAll.mq4
Download scriptThis script is a specialized utility designed for the MetaTrader trading platform to automatically clean up your workspace by removing specific visual elements from your charts.
How It Works
The primary function of this tool is to perform a "bulk cleanup" of custom markers or indicators that have been placed on your trading screen. Instead of requiring you to manually click and delete every individual icon, the script automates this process in one go.
The Logic Process
To ensure it only removes the specific elements you want while leaving your other charts, drawings, and indicators untouched, the script follows these steps:
- Inventory Scan: The script starts by scanning all the visual objects currently active on your chart. It looks at every single item—including lines, shapes, and labels.
- Identification Filtering: As it scans each object, it checks for a specific "name tag." Specifically, it looks for any object whose name begins with the prefix "WM(".
- Selective Removal: If the script finds an object that starts with that exact identification code, it treats it as a target and removes it from the display. If the object does not have that specific naming convention (for example, if it is a standard trend line you drew yourself), the script ignores it.
- Reverse Processing: The script performs this scan in reverse order. This is a technical safety measure to ensure that as objects are deleted, the list stays organized and no items are skipped during the cleanup process.
Summary for the User
Think of this script as a "selective vacuum." You can have your charts filled with many different types of drawings; when you run this script, it will scan the entire chart and only "vacuum up" the specific markers labeled with the "WM(" prefix, leaving everything else exactly where it is. It is an efficient way to clear out old data or specific wave markers to prepare your chart for a fresh analysis.
//+------------------------------------------------------------------+
//| s_WaveMarker_DeleteAll.mq4 |
//| * |
//| * |
//+------------------------------------------------------------------+
#property copyright "Integer"
#property link "for-good-letters@yandex.ru"
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
for(int i = ObjectsTotal() - 1; i >= 0; i--)
{
if(StringFind(ObjectName(i), "WM(", 0) == 0)
{
ObjectDelete(ObjectName(i));
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments