Daily Uptime Reporter
A trading terminal running unattended overnight can lose its connection, sit through a quiet feed gap, or simply stay up the whole time - and by morning there is usually no record of which one happened. This EA keeps a running tally through the day and writes one summary row at a declared hour: how long it has been running, how many tick gaps were seen on the chart symbol (and their total duration), and how many times IsConnected() transitioned from disconnected back to connected. A feed gap is counted whenever two consecutive ticks on the attached chart's symbol are further apart than InpGapThresholdSeconds - a reasonable proxy for "the feed stalled", though genuinely quiet symbols (weekend-adjacent hours, thin instruments) can also trigger it and are not distinguished from a real outage. A reconnect is counted on every observed false-to-true transition of IsConnected(), polled on a timer independent of price ticks so it keeps working through the very gaps it is measuring. Notes and limitations "Uptime" is this EA's own time since OnInit, not the terminal process's total uptime - MQL4 has no function that reports when the terminal itself was launched, so an EA attached partway through a session has no way to know how long the terminal had already been running before it attached. Feed-gap detection only covers the symbol of the chart this EA is attached to. Attach a separate instance per symbol to monitor more than one feed. A report is also written on OnDeinit (EA removed, terminal closed, chart symbol changed) so a session ending before the declared report hour is not lost, but this means a chart-symbol change or a manual restart also produces an extra report row outside the normal daily schedule.
Expert advisor · MT4 · v1.0 · Free
About Daily Uptime Reporter
Daily Uptime Reporter 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 Gap threshold seconds, Check seconds and Report hour. MQL source code included.
Files in the download: DailyUptimeReporter.ex4, DailyUptimeReporter.mq4, DailyUptimeReporter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Gap threshold seconds | 120 | Tick gap, in seconds, counted as a feed gap |
| Check seconds | 15 | How often connection state is polled |
| Report hour | 23 | Hour of day (0-23, terminal time) the daily report is written |
| Log file name | DailyUptimeReporter.csv | File 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: Alerts · MT4 Expert Advisor · MQL4 Source Code