Loading…

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

SettingDefaultWhat it does
Range lookback20Bars back used to build the range (excludes the trap bar itself)
Min poke points10Minimum poke beyond the range, in points, for the bar to count as a trap
Atr period14ATR period used for the stop and target
Stop atr multiple1.0Extra ATR buffer added beyond the trap bar's own extreme for the stop
Target atr multiple2.5Take profit distance from entry, ATR multiples
Use risk sizingfalseSize by percent risk to the initial stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, used only when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260370Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Breakout · Risk & Lot Size · ATR · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria