Loading…

Set File Bulk Parameter Editor

A trader who keeps a separate .set file per symbol or per strategy variant eventually hits the case where one parameter - a lot size, a magic number, a broker-specific stop distance - needs the same new value in every copy at once. Doing that by hand means opening each file in the Tester's input dialog, changing one field, saving, and repeating it a dozen or more times. This script does the same edit to every matching .set file in a chosen folder in one run. A .set file is plain text, one "key=value" line per parameter, in the exact order MetaTrader itself writes it. This script only ever rewrites the value half of the one line whose key matches InpKey - the key text, the '=' character and every other line in the file are copied through unchanged, so a diff against the original shows exactly one changed line and nothing else. A line MetaTrader itself has commented out with a leading ';' is left untouched rather than "fixed", since re-enabling a parameter a user deliberately disabled is not what a bulk editor should decide on its own. Files where the target key is not present are reported and skipped by default rather than having a new line invented for them, since guessing where an absent key belongs in a file the user did not originally write risks producing a .set file MetaTrader itself would not have written. Notes and limitations - Only files directly inside InpFolder are scanned; subfolders are not searched recursively. - A .set file with the target key repeated more than once (not something MetaTrader itself produces, but possible if hand-edited) has only its first matching line changed. - The sandbox restriction applies as with every MQL4 file operation: InpFolder must be a path under the terminal's own MQL4\Files, it cannot reach outside the sandbox to a general Windows folder. - This script edits input parameter presets only. It has no connection to any account, symbol or open position, and never places, closes or modifies a trade.

Script · MT5 · v1.0 · Free

About Set File Bulk Parameter Editor

Set File Bulk Parameter Editor is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Folder, Key and New value. MQL source code included.

Files in the download: SetFileBulkEditor.ex5, SetFileBulkEditor.mq5, SetFileBulkEditor.txt.

Settings

SettingDefaultWhat it does
FolderSetFilesSubfolder under MQL5\Files to scan (no leading slash)
KeyInpLotsThe key to change, exactly as it appears left of '='
New value0.01New value to write for that key
Only if key existstrueSkip a file that does not already contain the key
Dry run onlyfalseReport what would change without writing anything

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Risk & Lot Size · Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria