Runaway Guard
- Utilities
- Version: 1.0
- Activations: 10
Your risk tools watch your losses. Nothing watches your order rate - until a tool you bought fires forty trades in a minute.
Runaway Guard measures how fast orders are being placed on your account, per source, and acts only when a speed limit is crossed. It does not look at gains or losses. When something runs away, it writes one incident file with the actual deal tickets, so you can prove what happened instead of arguing about it.
FOUR SPEED LIMITS, MEASURED IN ROLLING WINDOWS
- Deal rate: how many deals arrived in the fast window. Default 20 deals per 5 minutes.
- Round trips: positions opened and closed again within a few seconds. Default 10 short closes per 15 minutes, where short means held under 60 seconds.
- Re-entry: closing and immediately opening the same symbol in the same direction. Default 5 re-entries per 15 minutes, where immediately means within 30 seconds.
- Cost burned by turnover: commission plus swap plus realised result over the slow window, as a percentage of balance. Default 0.5 percent per 15 minutes.
Each limit can be switched off by setting it to zero.
PER SOURCE, NOT PER ACCOUNT
Every deal carries the magic number of whatever produced it. Runaway Guard counts each magic number separately, and counts manual orders too as Manual / no magic. The account total is shown as its own row.
That matters because the thing that runs away is usually one Expert Advisor or one tool, not the whole account. You keep the rest running.
YOU CHOOSE WHAT HAPPENS, PER SOURCE
- Alert. Tell me, change nothing. This is the default.
- Cancel pendings. Remove the pending orders that belong to that source.
- Stop the chart. Close the chart that source is running on, so it stops producing new orders.
- Close the terminal. Off by default and behind a second switch, because it really does close MetaTrader.
THE INCIDENT FILE - THIS IS THE SECOND HALF OF THE PRODUCT
When a limit is crossed, one CSV file is written under MQL5/Files/RunawayGuard/. It contains fifteen columns: three clocks (broker, UTC and local), which limit was crossed, the measured value and the limit, the magic number, the symbol, deals, round trips, commission, swap, realised result, the action taken, and the list of deal tickets.
The deal tickets are real ticket numbers. You can match every one of them against your terminal history. Nothing in the file is an opinion, a score or an estimate.
Files are never overwritten and never deleted automatically.
THREE FILTERS SO IT DOES NOT CRY WOLF
- Warm-up. No action for the first 60 seconds after start, while the history is read.
- Session open. Limits are doubled for the first 120 seconds after the session opens.
- Exclusions. Any magic number can be excluded. Excluded sources are also removed from the account total, otherwise excluding one would still trip the account row.
After a source triggers, the same limit will not fire again for 10 minutes. Counting continues and the panel keeps showing it.
TWO SCREENS
- Watch: account, balance, state, window lengths, one row per source with deals, round trips, re-entries, cost and the chosen action, plus the last three incidents with their file names.
- Sources: for the selected source, the action, the exclusion switch, the chart link, and the current values against the limits.
The state is WATCHING, TRIGGERED or DISABLED. DISABLED never means it stopped counting - it means the chosen action cannot run right now, and the reason is printed as a line.
The panel can be dragged, remembers its position, and recalculates how many rows fit when the chart is resized. Settings survive a timeframe change and a terminal restart.
WHAT IT DOES NOT DO
- It does not open, close or modify positions. The trade action constants used to open, close or modify (DEAL, PENDING, SLTP, MODIFY, CLOSE_BY) do not appear anywhere in the source. The only trade call it makes is the removal of a pending order, which is what Cancel pendings means.
- It does not disable another Expert Advisor. MQL5 has no such call. What it can do is close the chart that EA is running on.
- It does not switch off the Algo Trading button. MQL5 cannot do that.
- It does not stop orders sent from a phone or another terminal. It detects them, because they reach the account history, but it cannot reach outside this terminal.
- It does not undo deals that already happened. It stops more from arriving and it writes down what arrived.
- It does not name a cause. It reports which magic number produced how many deals, and when.
- It does not use loss or drawdown as a trigger. Speed is the trigger. Money limits are a different tool.
- It does not send anything anywhere. No web requests, no server of ours, no external files, no DLLs.
FREE DEMO
The demo runs in the Strategy Tester. Because this product places no orders, the tester replays a synthetic burst of deals into the counting layer so you can watch detection, the panel and the incident file for yourself, with the default settings. The panel shows TESTER DEMO - synthetic sample, no orders are placed while this is running. Cancel pendings, Stop the chart and Close the terminal have no target inside the tester and are never called there.
REQUIREMENTS
- MetaTrader 5, any broker, any symbol. The guard watches the account, not a chart.
- Hedging accounts are what this was built and verified on. Netting accounts are implemented but have not been verified.
- Nineteen inputs, all with working defaults. There is no set file to ask for.
- English interface.
