Loading…

Tester Progress Telemetry

A long Strategy Tester pass or optimisation gives no obvious way to check progress except watching the terminal window, which is inconvenient if the test is running unattended or on a remote/headless box. This EA writes a one-row CSV to the sandboxed Files folder every time a new bar closes (or every N bars, to reduce disk writes on a fast test), containing the current wall-clock time, the simulated time reached, percent complete, elapsed wall-clock seconds and an estimated ETA - an outside script can tail this file on a timer and show progress without touching the terminal at all. The honest limitation stated plainly here: MQL4 has no function that reads back the Tester's own configured From/To dates, or the current pass number and total pass count during an optimisation. Neither is exposed to running code on either platform. This EA therefore needs the SAME From/To dates typed into its own inputs, matching whatever was set on the Settings tab, to compute percent complete at all - and during an optimisation, the telemetry file only ever describes the SINGLE pass currently executing on the thread that wrote it, not overall progress across the whole optimisation. A tool claiming to report full-optimisation ETA from inside one EA instance would be guessing at information it cannot actually see. Notes and limitations - If InpRangeFrom/InpRangeTo do not match the Tester's actual configured dates, PercentComplete will be wrong (it may exceed 100% early or never reach it) - there is no way for this EA to detect the mismatch itself, since it has no access to the real configured range. - ETA is estimated by simple linear extrapolation from wall-clock elapsed time versus simulated-time percent complete; a test that runs unevenly (e.g. dense tick data in some periods, sparse in others) will see the ETA estimate wander rather than count down smoothly - this is inherent to linear extrapolation, not a bug. - During an optimisation, each parallel Tester thread writes its OWN telemetry independently; if every thread shares the same InpTelemetryFile name, later writes overwrite earlier ones from other threads, so the file only ever reflects whichever thread wrote most recently. Give each thread a distinct file name (or accept that the file shows one thread's progress as a representative sample) for an optimisation run. - GetTickCount() wraps to zero after roughly 49.7 days of continuous terminal uptime; a single pass running that long in wall-clock time is not a realistic case this EA tries to handle, and is left as a documented limitation rather than worked around.

Expert advisor · MT4 · v1.0 · Free

About Tester Progress Telemetry

Tester Progress Telemetry is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Range from, Range to and Update every n bars. MQL source code included.

Files in the download: TesterProgressTelemetry.ex4, TesterProgressTelemetry.mq4, TesterProgressTelemetry.txt.

Settings

SettingDefaultWhat it does
Range from2023.01.01Must match the Tester Settings tab's "From" date exactly
Range to2023.12.31Must match the Tester Settings tab's "To" date exactly
Update every n bars1Rewrite the telemetry file every N new bars (1 = every bar)
Telemetry fileTesterProgressTelemetry_Status.csvOverwritten each update, under MQL4\Files\

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 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: Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria