Modelling Quality Pre Check
The Strategy Tester's "Every tick" mode is only as good as the minute data behind it. A range with large holes in its M1 history gets modelled from whatever ticks the tester can synthesise around the gaps, and the reported modelling quality percentage - buried in a report most people do not read until after a multi-hour optimisation finishes - is the tester's own admission that the run was not what it looked like. This script checks that before the run starts. It walks the M1 history for a chosen symbol and date range, counts how many bars actually exist, and compares that against how many weekday minutes the range should contain. The result is a coverage percentage and a plain-language prediction: near complete coverage supports Every tick, moderate coverage means expect control points only, and low coverage means treat the range as open prices only regardless of what setting is selected in the tester dialog. It also finds the gaps themselves. Every run of missing minutes above a threshold is logged with its start and end, sorted largest first, so the worst holes in the range are visible immediately rather than needing to be inferred from one summary percentage. A gap that lines up with a normal weekend close is not counted - only a gap during what should have been an open market counts as a genuine data hole. Notes and limitations - The expected-minutes figure excludes Saturday and Sunday only. Bank holidays, half days and thin pre-open minutes are not modelled, so a genuinely well-covered range can still show gaps around those dates - that is a true reading of the data, not a false alarm. - This script only inspects history already stored on this terminal. It does not request or download missing data. - The quality bands - Every tick, control points, open prices - are this script's own honest prediction based on coverage percentage, not a number read from MetaTrader's own modelling quality algorithm, which is not exposed to scripts. Treat it as a strong indicator, not a guarantee of what the tester report will say. - A multi-year range on an actively quoted symbol can take a noticeable moment to scan; the script reports its total once finished, there is no partial progress display.
Script · MT5 · v1.0 · Free
About Modelling Quality Pre Check
Modelling Quality Pre Check is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Symbol, From date and To date. MQL source code included.
Files in the download: ModellingQualityPreCheck.ex5, ModellingQualityPreCheck.mq5, ModellingQualityPreCheck.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to check, blank = this chart's symbol | |
| From date | D'2024.01.01 00:00' | Range start |
| To date | 0 | Range end, 0 = now |
| Gap threshold minutes | 5 | Gap size that counts as a data hole |
| Max gaps to list | 20 | Largest gaps printed to the log |
| Write report file | true | Write the full gap list to CSV |
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 · MT5 Script · MQL5 Source Code