Server Ping Burst Report
Native MQL4 cannot measure a genuine network ping. An ICMP ping or a raw TCP round trip both require a DLL, which this catalogue does not use. What MQL4 can measure without one is how long the terminal itself takes to respond to RefreshRates() - a call that asks the terminal to pull the latest tick data it already holds. Timing a short burst of these calls with GetTickCount() reacts to genuine connection trouble (the call tends to take longer when the feed is stale or the terminal is busy), but it is NOT the same thing as measuring latency to the broker's server, and this script says so plainly in its own output rather than calling itself a ping. The report samples a configurable burst (default 20 samples, 200ms apart), then prints the mean, standard deviation ("spread") and the worst single sample in milliseconds, plus the best sample for reference. A wide spread or a high worst-case relative to the mean is the useful signal here - a single number alone hides whether responsiveness is steady or spiky. Notes and limitations This measures local terminal-to-cache latency via RefreshRates(), not a true network round trip to the broker's trade or price server - there is no built-in, DLL-free way to measure that in MQL4. Treat a rising trend or a widening spread across repeated runs as a signal worth investigating, not as an exact millisecond figure for the connection itself. A Script running once cannot be stopped mid-burst except by the terminal's own "remove script" action, which the script checks for via IsStopped() between samples and reports whatever partial burst was collected.
Script · MT5 · v1.0 · Free
About Server Ping Burst Report
Server Ping Burst Report is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Sample count and Interval ms. MQL source code included.
Files in the download: ServerPingBurstReport.ex5, ServerPingBurstReport.mq5, ServerPingBurstReport.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Sample count | 20 | Number of samples in the burst |
| Interval ms | 200 | Delay between samples (milliseconds) |
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