Include Dependency Reporter
A compiled .ex4 carries no visible manifest of what went into it. When a large EA is assembled from several internal headers - a risk module, a trailing-stop engine, a session filter, a retry policy - and a user reports unexpected behaviour, "which exact combination of components, and which versions of each, are you actually running" is usually unanswerable from the outside. Asking the user to read source code is not realistic; asking them to paste one Print() block is. This library is a genuine, small registry, not a placeholder. Each component calls IdrRegister(name, version, [note]) once, typically from its own setup code, and the values land in a fixed-size set of parallel arrays (a dynamic array member inside a struct has no safe value semantics in MQL4, so the registry lives as plain module-level globals rather than a copyable struct instance - see house style). A re-registration of an already-known name overwrites its entry in place rather than adding a duplicate row, so components that re-initialise (an OnInit() rerun after an input change, for example) do not pollute the report with repeats. IdrBuildReport() assembles the formatted block; IdrPrintReport() prints it to the Experts/Journal log one line at a time (a single Print() call with embedded newlines only shows its first line in the terminal's log view, which this works around); IdrExportReportToFile() writes the same text to MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) so it can be attached as a file instead of copied from the log. Notes and limitations - Fixed registry capacity of 64 components (IDR_MAX_COMPONENTS). This is generous for any realistic project; IdrRegister() returns false once full rather than silently dropping or crashing. - The registry is purely in-memory and per-run - it is not persisted across restarts and is not automatically populated. Every component that wants to appear in the report must call IdrRegister() itself; nothing here inspects #include directives or scans the compiled binary. - IdrExportReportToFile() writes inside the standard MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) sandbox only (or MQL4\Files\ (or MQL5\Files\ on the native MQL5 build)Common\ if reworked to pass FILE_COMMON) - it cannot write anywhere else on disk, per the MQL4 file-I/O sandbox. - Report field order is registration order, not alphabetical - callers who want a specific presentation order should register components in that order.
Script · MT4 · v1.0 · Free
About Include Dependency Reporter
Include Dependency Reporter is a script for MetaTrader 4. It has 3 settings, such as Program name, Program version and Export file name. MQL source code included.
Files in the download: IncludeDependencyReporter.mqh, IncludeDependencyReporter.txt, IncludeDependencyReporterDemo.mq4.
Settings
| Setting | Default | What it does |
|---|---|---|
| Program name | IncludeDependencyReporterDemo | Name of the host program shown in the report |
| Program version | 1.00 | Version of the host program shown in the report |
| Export file name | IncludeDependencyReporterDemo_Report.txt | Written under MQL4\Files\ |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Trading Sessions · Trailing Stop & Break-even · MT4 Script · MQL4 Source Code