Utils / FolderTaskToCSV
A set of experts that iterate over a folder of .set files, modify the data generation parameter in each one and produce a CSV file with the resulting backtesting tasks.
Each variant differs in how the input folder is organised and where the timeframe for each task is obtained.
FolderTaskToCSV
Basic variant. Expects one level of subfolders per symbol. The timeframe is read directly from the content of each .set.
Expected folder structure
InpFolder/
├── EURUSD/
│ ├── config_a.set
│ └── config_b.set
└── GBPUSD/
└── config_c.set
- Level 1 — folder named after the symbol (e.g.
EURUSD) - Level 2 —
.setfiles ready for the Strategy Tester
Input parameters
| Parameter | Type | Description |
|---|---|---|
InpFolder |
string | Relative path to the root folder containing the symbol subfolders. Must end in \. |
InpFolderIsInCommon |
bool | true to resolve the path from the terminal Common folder. false to resolve from the terminal Data folder. |
InpParamTimeframeName |
string | Exact name of the parameter inside the .set from which the timeframe is read (e.g. InpTimeframe). |
InpParamActiveGenerateName |
string | Exact name of the parameter inside the .set that activates data generation (e.g. InpGenerateMode). The expert overwrites it to true in each file. |
InpDataStartDate |
datetime | Start date of the data range for all tasks. 0 for no limit. |
InpDataEndDate |
datetime | End date of the data range for all tasks. 0 for no limit. |
InpCsvFileNameOutput |
string | Output CSV file name (e.g. task.csv). |
InpCsvFileNameOutputIsInCommon |
bool | true to save the CSV in the Common folder. false to save it in the Data folder. |
InpStrMatchExcluyed |
string | Strings separated by ... to define file extensions/names that will be excluded from the task creation process |
InpStrMatchIncluyed |
string | Strings separated by .. to define file extensions/names that will be included in the task creation process |
Note por separator: "..." = "|", check https://forge.mql5.io/nique_372/MQLArticles/src/branch/main/Utils/StrMatch/README.md for mos examples of use por "strings" for define incluyed\excluyed >extensions and files
Behaviour
- Iterates
InpFolderlooking for symbol subfolders. - Inside each symbol, processes the
.setfiles found directly. - For each
.set, reads the value of theInpParamTimeframeNameparameter to get the timeframe. - Overwrites the
InpParamActiveGenerateNameparameter totruedirectly in the file (to activate data generation). - Builds a task with the symbol, the read timeframe and the path to the
.set. - Saves all tasks to the CSV indicated by
InpCsvFileNameOutput. - Returns
INIT_FAILEDintentionally to unload itself automatically when done.
Notes
- Subfolders deeper than 1 level are not processed. Any additional folder is skipped with a log warning.
- If the
InpParamTimeframeNameorInpParamActiveGenerateNameparameter is not found in a.set, that file is skipped and a warning is logged.
FolderTaskToCSV2
Extended variant. Adds an intermediate level of subfolders per timeframe. The timeframe is inferred from the folder name, not from the .set content.
Expected folder structure
InpFolder/
├── EURUSD/
│ ├── M1/
│ │ ├── config_a.set
│ │ └── config_b.set
│ └── H4/
│ └── config_c.set
└── GBPUSD/
└── D1/
└── config_d.set
- Level 1 — folder named after the symbol (e.g.
EURUSD) - Level 2 — folder named after the timeframe (e.g.
M1,H4,D1) - Level 3 —
.setfiles ready for the Strategy Tester
Input parameters
| Parameter | Type | Description |
|---|---|---|
InpFolder |
string | Relative path to the root folder containing the symbol subfolders. Must end in \. |
InpFolderIsInCommon |
bool | true to resolve the path from the terminal Common folder. false to resolve from the terminal Data folder. |
InpParamActiveGenerateName |
string | Exact name of the parameter inside the .set that activates data generation (e.g. InpGenerateMode). The expert overwrites it to true in each file. |
InpDataStartDate |
datetime | Start date of the data range for all tasks. 0 for no limit. |
InpDataEndDate |
datetime | End date of the data range for all tasks. 0 for no limit. |
InpCsvFileNameOutput |
string | Output CSV file name (e.g. task.csv). |
InpCsvFileNameOutputIsInCommon |
bool | true to save the CSV in the Common folder. false to save it in the Data folder. |
InpStrMatchExcluyed |
string | Strings separated by ... to define file extensions/names that will be excluded from the task creation process |
InpStrMatchIncluyed |
string | Strings separated by .. to define file extensions/names that will be included in the task creation process |
Note por separator: "..." = "|", check https://forge.mql5.io/nique_372/MQLArticles/src/branch/main/Utils/StrMatch/README.md for mos examples of use por "strings" for define incluyed\excluyed >extensions and files
Behaviour
- Iterates
InpFolderlooking for symbol subfolders. - Inside each symbol, iterates the timeframe subfolders.
- For each
.set, overwrites theInpParamActiveGenerateNameparameter totruedirectly in the file. - Builds a task with the symbol, the timeframe read from the folder name and the path to the
.set. - Saves all tasks to the CSV indicated by
InpCsvFileNameOutput. - Returns
INIT_FAILEDintentionally to unload itself automatically when done.
Notes
- Subfolders deeper than 2 levels are not processed. Any additional folder is skipped with a log warning.
- Timeframe folder names must match the formats recognised by
StrShortTimeframeToEnumNoRef(e.g.M1,M5,M15,M30,H1,H4,H6,H8,H12,D1,W1,MN). Any unrecognised name is interpreted asPERIOD_CURRENT.
Common notes
- The
.setfiles folder must be copied as-is to the terminal'sProfiles\Tester\so the Strategy Tester can locate them correctly. - Both experts modify the
.setfiles on disk during execution. It is recommended to work on a copy if the original state needs to be preserved.
AiTaskRunnerByLeo
QuickStart
Panel
General
Data generation
Feature Editor
Training
AI
Utils
Workflows
Config
External Scripts