Stop Hunt Post Mortem
Nearly every trader has watched a stop get hit and then watched price run to where they were aiming. Memory is a bad judge of how often that actually happens, because the dramatic misses stick and the ordinary stop-outs that stayed stopped-out do not. This script replaces the feeling with the record: for every closed losing trade whose exit price sits close to its recorded stop loss, it walks forward from the close time on a chosen timeframe and checks whether price reached the original take profit - or, when none was set, a target computed from the stop distance and a configurable reward multiple - within a bounded window. Being "stopped out" is judged against the stop distance itself rather than a fixed pip count, because a tolerance that makes sense on a five-pip scalp does not make sense on a two-hundred-pip swing trade on the same account. Trades that closed at a loss for some other reason - a manual close, a margin call, an expired pending fill with no stop set - are excluded rather than miscounted, because the tool cannot tell a stop-out from an ordinary loss without a stop loss on record to test against. Every match is reported individually with what the target would have been worth in money, computed from the symbol's own tick value and tick size so gold and JPY crosses are not mispriced by a flat pip-value assumption. The summary totals the booked loss on the matching trades against what the target implied, so the final figure is a real number, not a vibe: this many stop-outs, this many reversed to target, this much money either side of the line. This is deliberately not framed as proof of manipulation. A level attracts stops because retail traders cluster their orders at round numbers and obvious swing points, and price reverses off those levels for entirely ordinary liquidity reasons that have nothing to do with any single account being targeted. What the report gives you is the actual cost of placing stops where you have been placing them, which is useful regardless of why the reversals keep happening. Notes and limitations - Requires a stop loss on record for the trade. Trades closed manually, by an EA that manages exits without ever setting OrderStopLoss, or by a margin call cannot be classified and are skipped rather than guessed at. - The forward scan needs history loaded on the chosen timeframe past the trade's close time. A trade closed very recently, scanned against a high timeframe with a long forward window, may run out of loaded history before the window completes - such trades are reported as "not reached," which is not the same as "confirmed it never reached." - A high reversal rate is a property of where you place stops relative to visible levels, not evidence of broker misconduct. Read the notes above before drawing a conclusion from the summary. - "Value at target" is the target's distance from entry priced through the symbol's own tick value, not the actual money you would have made - it does not know what your take profit logic would really have done, or whether slippage would have affected the exit. - This is a read-only reporting tool. It does not place, modify, or close any order, and it never touches open positions.
Script · MT4 · v1.0 · Free
About Stop Hunt Post Mortem
Stop Hunt Post Mortem is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Symbol filter, Magic filter and Forward bars. MQL source code included.
Files in the download: StopHuntPostMortem.mq4, StopHuntPostMortem.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol filter | Only trades on this symbol, blank = every symbol | |
| Magic filter | -1 | Only trades with this magic, -1 = every magic |
| Forward bars | 96 | Bars to look forward from the stop-out for a reversal |
| Timeframe | PERIOD_H1 | Timeframe used to scan the forward window |
| Default reward multiple | 1.5 | Target distance as a multiple of the stop distance when no TP was set |
| Stop tolerance fraction | 0.15 | How close the close price must be to the stop to count as "stopped out" |
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 Script · MQL4 Source Code