Sweep And Reclaim System
A bare close beyond a recent swing level is ambiguous: it could be the start of a real breakout, or it could be a stop-run that runs out of follow-through. This system specifically wants the shape that separates the two - a wick that pokes through the level by a minimum distance, followed by the SAME bar closing back on the original side, reclaiming most of its own range in the process. A clean breakout close with no wick through the level first does not qualify; neither does a wick that sweeps the level but closes near its own extreme rather than reclaiming it. The swing level itself is the highest high or lowest low over a trailing lookback window (excluding the signal bar), so it re-centres on wherever the market has actually been making its recent extremes, rather than a fixed round-number level. The stop sits a small buffer beyond the sweep's own extreme - the level a genuine breakout would need to hold, not just touch - and the target is a configurable reward:risk multiple of that stop distance. Notes and limitations - Only one position at a time; a new sweep is ignored while a trade from a previous one is still open. - A market making a genuine, sustained breakout can still produce an occasional wick-and-reclaim bar before continuing - this system will take that trade and be wrong; the fixed stop bounds the loss. - The swing level recalculates every bar from the trailing lookback, so it can shift meaningfully after a strong directional run even without a new signal firing. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.
Expert advisor · MT4 · v1.0 · Free
About Sweep And Reclaim System
Sweep And Reclaim System is an expert advisor (trading robot) for MetaTrader 4. It can size trades from your balance and risk percent. It has 12 settings, such as Swing lookback, Min sweep pips and Max reclaim body pct. MQL source code included.
Files in the download: SweepAndReclaimSystem.ex4, SweepAndReclaimSystem.mq4, SweepAndReclaimSystem.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Swing lookback | 30 | Bars scanned (excluding the signal bar) to find the swing high/low to sweep |
| Min sweep pips | 3.0 | Minimum distance the wick must poke beyond the swing level, in pips |
| Max reclaim body pct | 60.0 | Signal bar's close must reclaim at least this % of its own range back past the level |
| Stop buffer pips | 5.0 | Stop placed this many pips beyond the sweep's own extreme |
| Target rr | 2.0 | Target distance as a multiple of the stop distance (reward:risk) |
| Use risk sizing | true | Size by percent risk to the stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a sizing fallback |
| Magic number | 35801 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
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 → Experts.
- 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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Breakout · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code