Preset Library Curator
Traders who collect .set files from forums, vendors and their own tuning runs end up with a folder full of near-identically named presets, several of which are byte-for-byte the same file saved twice under different names. Scrolling through that folder in the "Load preset" dialog to find the right one is slow, and nobody notices the duplicates until disk space or dialog scrolling becomes annoying. This script reads every .set file in a chosen sub-folder, computes a simple content checksum (byte sum plus file size - MQL4 has no built-in cryptographic hash function, so this is a deliberately simple but adequate check for text-based set files) and flags any file whose size and checksum match an earlier one as a duplicate. It can optionally delete duplicates, keeping the first occurrence it found. For files that are not duplicates, it looks for a recognised symbol name (the major and minor forex pairs, gold, silver and a couple of index names) and a recognised timeframe token inside the filename, and renames the file to a SYMBOL_TF_originalname.set shape when both are found. Files where nothing is recognised are left untouched rather than guessed at. Finally it writes a plain-text catalogue listing every file with its parsed symbol, timeframe, size and status (OK, duplicate, or deleted), so the whole library can be reviewed at a glance without opening MetaEditor or the preset-load dialog. Notes and limitations Only works on files already inside the MQL4\Files sandbox - it cannot list or move files from MQL4\Presets or anywhere else on disk, because no MQL4 program can. Moving files in and out of MQL4\Presets is a manual step. Duplicate detection is a byte-sum-plus-size checksum, not a cryptographic hash. Two different files could theoretically collide, though this is vanishingly unlikely for real .set files of different content and is not a concern for a personal preset library curation tool. Symbol and timeframe recognition is a fixed list of common tokens (major and minor pairs, gold, silver, a couple of indices, and the standard timeframe abbreviations). An exotic symbol or an unusual naming scheme will simply not be renamed - the file is left as-is, never guessed at incorrectly. The script processes up to 2000 files in one run; a folder larger than that needs to be split and run in batches.
Script · MT5 · v1.0 · Free
About Preset Library Curator
Preset Library Curator is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message, shows several symbols in one panel and is set up for gold (XAUUSD). It has 4 settings, such as Source folder, Catalogue file and Rename by symbol tf. MQL source code included.
Files in the download: PresetLibraryCurator.ex5, PresetLibraryCurator.mq5, PresetLibraryCurator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Source folder | PresetLibrary | Sub-folder of MQL5\Files to scan for .set files |
| Catalogue file | PresetCatalogue.txt | Output catalogue file name (written to MQL5\Files) |
| Rename by symbol tf | true | Rename files to <Symbol>_<TF>_<original>.set when parsable |
| Delete duplicates | false | Delete duplicate files (keeps the first occurrence) |
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 · Dashboards & Scanners · Gold (XAUUSD) · MT5 Script · MQL5 Source Code