Failed Breakout Reversal System
A breakout fails more often than the marketing around breakout systems admits, and the failure itself is a tradeable, well-defined event: a "trap bar" pushes its high or low beyond a tracked range - at least InpMinPokePoints past it - but then CLOSES back inside that same range. Everyone who entered on the poke, expecting a genuine breakout, is now positioned the wrong way, and their eventual stop-outs or exits become the flow this system trades into. The range is the highest high / lowest low of the InpRangeLookback bars immediately BEFORE the candidate trap bar - the trap bar's own poke is deliberately excluded from the range calculation so it cannot inflate the very level it is being measured against. A bar that closes beyond the range instead of back inside it is a real breakout by this definition, not a trap, and is left alone; only the close decides which one occurred, the poke alone is not enough. Entry direction fades the poke: a failed poke ABOVE the range is sold, stopped beyond that bar's own high; a failed poke BELOW the range is bought, stopped beyond its own low. Notes and limitations - Only one position at a time; while a trade is open, new trap bars on the same or opposite side are not evaluated. - A trap bar with a very large poke, well beyond InpMinPokePoints, still qualifies the same as a bar that barely cleared the threshold - the size of the poke is not itself part of the entry decision. - The stop and target are fixed at entry with no trailing management, so a fade that keeps going can give back a meaningful part of an open gain before the target is reached. - This trades a mechanically defined trap-and-close-back-inside event only; it makes no claim about the cause (stop hunting, exhaustion, liquidity) beyond the pattern itself. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.
Expert advisor · MT5 · v1.0 · Free
About Failed Breakout Reversal System
Failed Breakout Reversal System is an expert advisor (trading robot) for MetaTrader 5 based on ATR. It can size trades from your balance and risk percent and trades breakouts. It has 12 settings, such as Range lookback, Min poke points and Atr period. MQL source code included.
Files in the download: FailedBreakoutReversal.ex5, FailedBreakoutReversal.mq5, FailedBreakoutReversal.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 |
|---|---|---|
| Range lookback | 20 | Bars back used to build the range (excludes the trap bar itself) |
| Min poke points | 10 | Minimum poke beyond the range, in points, for the bar to count as a trap |
| Atr period | 14 | ATR period used for the stop and target |
| Stop atr multiple | 1.0 | Extra ATR buffer added beyond the trap bar's own extreme for the stop |
| Target atr multiple | 2.5 | Take profit distance from entry, ATR multiples |
| Use risk sizing | false | Size by percent risk to the initial stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, used only when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Magic number | 20260370 | 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 5 open File → Open Data Folder, then go to MQL5 → Experts.
- 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 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 · ATR · MT5 Expert Advisor · MQL5 Source Code