Minimum Increment Empirical Scanner
MODE_TICKSIZE is a configuration value the broker sets, not a measured property of the price feed. Two ways this can quietly disagree with reality: some brokers set it looser than anything the feed ever actually quotes, and some symbols - particularly ones added or reconfigured recently - report it as zero outright. Any code that normalises prices to MODE_TICKSIZE on faith inherits whatever is wrong with that value, silently. This script checks the declared value against what actually happened. For each symbol it walks a window of closed bars on a chosen timeframe, computes every consecutive close-to-close difference, and keeps the smallest non-zero one as the observed minimum increment. That gets compared to MODE_TICKSIZE as a ratio; a ratio well away from 1.0 in either direction - coarser observed movement than declared, or finer - is flagged, and a zero MODE_TICKSIZE is always flagged outright regardless of what was observed. This is a bar-close scan, not a tick-by-tick one - it looks at the M1 (by default) close series rather than every individual quote, which is a much cheaper way to get a representative sample of real price granularity over a meaningful stretch of history without holding a live tick feed open. A symbol that barely moved during the scan window naturally produces fewer usable samples and is reported as "insufficient samples" rather than a false confident answer built on almost nothing. Notes and limitations - This measures what happened during the scan window, not a mathematical guarantee about the feed. A very quiet symbol can under-report how fine its real granularity is simply because it never moved by the smallest possible amount during the sample. - Only bars already loaded in the terminal are scanned; this script does not download or force a history refresh. - A tiny floating-point noise floor (one hundredth of a point) is applied before counting a close-to-close move as real, so binary rounding dust from repeated arithmetic cannot masquerade as the minimum increment. - This does not attempt to fix or override MODE_TICKSIZE anywhere - it is a read-only diagnostic. Code that needs a safe substitute for a zero or unreliable tick size should fall back to MODE_POINT, as this catalogue's house style already recommends elsewhere.
Script · MT4 · v1.0 · Free
About Minimum Increment Empirical Scanner
Minimum Increment Empirical Scanner is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol list, Timeframe and Bars to scan. MQL source code included.
Files in the download: MinimumIncrementScanner.mq4, MinimumIncrementScanner.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol list | Semicolon-separated symbols to scan (blank = every Market Watch symbol) | |
| Timeframe | PERIOD_M1 | Timeframe used to sample price changes |
| Bars to scan | 2000 | Closed bars to walk per symbol |
| Min samples | 20 | Minimum non-zero moves needed before a result is trusted |
| Mismatch factor | 2.0 | Flag when observed/declared ratio exceeds this either way |
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: Dashboards & Scanners · Alerts · MT4 Script · MQL4 Source Code