Sandbox Usage Reporter
Every EA, script and indicator that writes to disk shares the same sandbox folder, MQL4\Files, and MQL4 keeps no record of which program wrote which file. After running a terminal for a few months that folder tends to fill up with logs, .csv exports, .set snapshots and one-off dumps from a dozen different tools, with no built-in way to see what is actually taking up space or how stale it is. This script scans MQL4\Files (plus any subfolders you list) and groups files by inferred producing program: the text before the first separator character in the filename (an underscore by default), or before the first '.' when no separator is present. Most tools in this catalogue, and most well-behaved third-party tools, already prefix their own output files this way, so the grouping is usually accurate - but it is a naming heuristic, not real ownership metadata, because MQL4 genuinely has none to read. For each group it reports the file count, total bytes, and the age in days of both the oldest and newest file, sorted with the largest group first, so you can see at a glance which tool is worth cleaning up after. Notes and limitations - Grouping by filename prefix is a heuristic. A file that does not follow a "<Program><separator>rest" or "<Program>.ext" naming pattern will be grouped under its own full name, which is technically correct but not always meaningful. - Only the root of MQL4\Files and the subfolders you explicitly name are scanned. MQL4's file API has no reliable way to tell a subfolder entry apart from a regular file, so this script does not attempt to recurse blindly - any subfolder entry it does encounter simply fails the size read and is counted under "entries skipped" rather than guessed at. - "Age" is the file's last-modified date as reported by the operating system, not a MetaTrader-specific timestamp. - This is a read-only reporting tool. It never deletes, moves or renames anything.
Script · MT5 · v1.0 · Free
About Sandbox Usage Reporter
Sandbox Usage Reporter is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Subfolders, Include common files and Group separator. MQL source code included.
Files in the download: SandboxUsageReporter.ex5, SandboxUsageReporter.mq5, SandboxUsageReporter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Subfolders | Semicolon list of extra subfolders under MQL5\Files to scan (root is always scanned) | |
| Include common files | false | Also scan the shared Common\Files folder under the same subfolder names |
| Group separator | _ | Character that splits "ProducingProgram<sep>rest.ext" into its group |
| Max groups | 60 | Safety cap on distinct groups tracked before extra ones fall into an overflow bucket |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code