Order Rate Anomaly Alarm
A stuck OnTick loop or a copier that starts re-sending the same signal does not announce itself. The first visible symptom is usually a wall of tickets in the account history, by which point real damage is already done. This tool watches order creation rate across the entire terminal, not just one chart or one EA, and raises an alert the moment the count of orders opened inside a trailing window crosses a configured threshold. It is read-only. It never sends, closes, or modifies an order itself - it only counts and alerts - so it is safe to run alongside any live strategy as a second pair of eyes rather than something that could itself interfere with trading. Both the live order pool and the closed-order history are scanned, so a ticket that opened and closed again between two polls (fast enough to never appear in the open pool at all) is still counted. Already-seen tickets are tracked so the same order is never counted twice as the pool re-orders itself. Notes and limitations - Detection latency is bounded by InpTimerIntervalSec - an order counted right after a poll is only noticed on the next one. - The seen-ticket dedup set is a fixed-size ring buffer; on an account with extremely high turnover it can evict an old ticket before a very late-arriving history entry for it is seen, in the rare case that would cause a double count. - The alarm is a single threshold with no hysteresis band - it can flap on and off if the order rate sits right at the edge of the threshold. - Alerts and flattens nothing itself; response is entirely up to the trader.
Expert advisor · MT4 · v1.0 · Free
About Order Rate Anomaly Alarm
Order Rate Anomaly Alarm 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 Window seconds, Threshold count and Timer interval sec. MQL source code included.
Files in the download: OrderRateAnomalyAlarm.ex4, OrderRateAnomalyAlarm.mq4, OrderRateAnomalyAlarm.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Window seconds | 60 | Trailing window checked for the order burst |
| Threshold count | 10 | Orders opened inside the window that trips the alarm |
| Timer interval sec | 2 | How often the order pools are rescanned |
| Event buffer size | 300 | Ring buffer capacity for tracked order-open events |
| Max tracked tickets | 1000 | Ring buffer capacity for already-seen open tickets |
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: Grid · Buy/Sell Arrows · Alerts · Trailing Stop & Break-even · Trade Copier · MT4 Expert Advisor · MQL4 Source Code