Copier Duplicate Trade Detector
A trade copier reconnecting mid-signal, or a manual click racing an automated one, produces a very specific and recognisable pattern: two live tickets on the same symbol and side, opened moments apart, where only one was intended. Scrolling through the terminal's history tab by eye rarely catches this, especially on an account with hundreds of closed trades. This script compares every pair of trades - loaded from history and, optionally, still-open orders - and flags any pair that shares a symbol, shares a direction, has a lot size within a configurable tolerance, and opened within a configurable number of seconds of each other. Matching is judged on open time only, deliberately never on open price: two unrelated trades can share a price by pure coincidence at a stable market, but two trades opened a second apart on the same symbol and side is exactly the shape a duplicate signal produces, price aside. Different magic numbers do not clear a pair from suspicion. A copier often stamps the receiving side of a signal with its own magic number, distinct from the source, so two trades with different magics opened together are still reported rather than assumed unrelated. Notes and limitations - Reports suspected duplicates only - it never closes, modifies or otherwise touches any order. Confirming and acting on a flagged pair is the trader's own decision. - Two genuinely independent strategies that happen to open the same symbol and side within the tolerance window (e.g. two unrelated breakout systems triggering on the same news spike) will also be flagged - the pattern match cannot distinguish intent, only timing and size. - Pending orders that never filled are excluded, since they carry no meaningful fill time to compare. - Comparison is a simple pairwise scan, deliberately not optimised with sorting or indexing - fine for the history sizes this tool is meant for, not intended for an account with tens of thousands of trades.
Script · MT5 · v1.0 · Free
About Copier Duplicate Trade Detector
Copier Duplicate Trade Detector is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Tolerance seconds, Lot tolerance and Include open orders. MQL source code included.
Files in the download: CopierDuplicateDetector.ex5, CopierDuplicateDetector.mq5, CopierDuplicateDetector.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Tolerance seconds | 5 | Maximum gap between two open times to call them "near-simultaneous" |
| Lot tolerance | 0.001 | Maximum lot-size difference to still call the volumes "the same" |
| Include open orders | true | Also compare against currently open positions, not history only |
| Max history to scan | 2000 | Most recent closed trades to load from history (0 = every closed trade) |
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: Volume · Buy/Sell Arrows · Trade Copier · Alerts · MT5 Script · MQL5 Source Code