Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The False Breakout Hedge is a pure price-action expert advisor (EA) built around two classic discretionary tools: floor pivot points and the engulfing candlestick pattern. It uses no traditional indicators — there is no moving average, RSI, ATR, or Bollinger Band anywhere in its logic. Instead, it reads structure directly from price, anchoring its decisions to the daily pivot levels (PP, R1, S1, R2, S2) that intraday desks watch, and confirming momentum with engulfing candles that swallow the prior bar. Its trading style is short-term breakout scalping with a built-in reversal hedge.
This strategy is designed for liquid, "range-then-trend" instruments where price tends to coil near a level, break out, and either run or snap back. Think FX majors such as EUR/USD, GBP/USD, or USD/JPY, as well as gold (XAU/USD) or an index CFD, traded on intraday timeframes like M5, M15, or M30. The design assumes a market where genuine pivot breakouts and false breakouts (stop hunts) alternate regularly — exactly the environment that frustrates a naive breakout trader.
As a learning tool, the False Breakout Hedge is well suited to traders who want to study how breakout confirmation, candlestick patterns, and hedging interact in a single rules-based system. It is best treated as a framework for understanding price-action mechanics — not as a shortcut. Everything below frames the EA as a strategy to analyze and learn from, not as a profit opportunity.
How It Works
The strategy reads each completed bar, maintains a running session, and recalculates its pivot levels once per day. Here is what it does, step by step:
- Builds session pivots: Each closed bar is folded into the current calendar day's running high, low, and close. When the day rolls over, the just-completed session's H/L/C define the pivots that stay fixed for the whole new day (they never repaint intrabar). The formulas are the standard floor pivots:
PP = (H+L+C)/3,R1 = 2·PP − L,S1 = 2·PP − H,R2 = PP + (H−L),S2 = PP − (H−L). Every distance the EA uses scales to the sessionrange(H − L), so nothing is pip-hard-coded. - Signals a long breakout: The strategy signals a long when a bullish engulfing bar (its body fully swallows the prior bearish body) opens at or below R1 and closes decisively above it — specifically
Close > R1 + BreakFrac·range. The interpretation is that resistance has failed upward, so the EA buys the break and scalps toward R2. - Signals a short breakout: The mirror image. A bearish engulfing bar that opens at or above S1 and closes decisively below it signals that support has failed downward. The EA sells the break and scalps toward S2.
- Conviction filter: Before any entry, the signal bar's body must be at least
MinBodyFracof its own high-low range, so weak, indecisive candles are skipped. - Stop-loss logic: The base stop sits a structural pad beyond the engulfing bar's opposite extreme — below the bar's low for longs, above its high for shorts — sized by
StopBufferFracof the range (and never closer than the broker's minimum stop distance). - Take-profit logic: The base target is the next pivot (R2 for longs, S2 for shorts), but capped to a scalp-sized
TpFracof the session range so the EA banks quick, tight moves rather than waiting for a full pivot-to-pivot run. - The hedge — the signature mechanic: While a lone base leg is open, if a later bar closes back through the broken level by
FailFrac·range, the breakout is declared false. The EA then deploys an opposite market leg (volume = base ×HedgeMult) to ride the snap-back. At this point it holds both directions — a genuine locked hedge. This is what turns the classic "bought the high of a fakeout" loss into a potential scratch or recovery. - Basket money management: Once any exposure is held, the EA monitors net floating profit/loss every tick. If net floating P/L reaches
BasketTpMoney, it closes everything and banks the result. If net floating loss reachesBasketSlMoney, it flattens as a hard cap (the failure mode is a violent one-way trend right after the hedge locks). Individual stop-losses and take-profits remain as backstops.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| MinBodyFrac | 0.55 | 0.20 | 0.95 | Engulfing body must be at least this fraction of its own high-low range — a conviction filter that rejects weak signal bars. |
| BreakFrac | 0.05 | 0.00 | 0.50 | How far beyond the pivot the bar must close to count as a real break, as a fraction of the session range. |
| TpFrac | 0.60 | 0.10 | 3.00 | Scalp take-profit distance as a fraction of the session range (capped at the next pivot). |
| StopBufferFrac | 0.15 | 0.02 | 1.00 | Stop-loss pad placed beyond the engulfing bar's opposite extreme, as a fraction of the range. |
| FailFrac | 0.10 | 0.02 | 1.00 | A close back through the broken level by this fraction of range confirms a false break and triggers the hedge. |
| HedgeMult | 1.50 | 0.50 | 3.00 | Recovery-hedge volume as a multiple of the base leg. |
| BasketTpMoney | 30.0 | 5.0 | 2000.0 | Banks the whole basket once net floating profit reaches this amount (account currency). |
| BasketSlMoney | 400.0 | 50.0 | 100000.0 | Flattens the whole basket once net floating loss reaches this amount (account currency). |
| MaxSpreadPoints | 40 | 0 | 500 | Skips new entries while spread (in points) exceeds this value (0 = off). |
| Lots | 0.10 | 0.01 | 1.00 | Base position volume in lots. |
| Magic | 8310 | 0 | 9,999,999 | Unique magic number identifying this EA's positions. |

Recommended Chart Settings
The False Breakout Hedge was designed for liquid, intraday instruments where pivot breakouts and fakeouts alternate. Suitable candidates include FX majors such as EUR/USD, GBP/USD, and USD/JPY, as well as XAU/USD (gold) or a major index CFD. Recommended timeframes are M5, M15, or M30 — short enough for scalp-sized targets, but long enough that the daily session pivots carry meaning. Because every distance scales to the session range rather than to fixed pip values, the EA adapts to whatever symbol and timeframe you select at test time.
Keep in mind that results will vary considerably across different market conditions. A tight-spread broker matters for a scalping approach, which is why the MaxSpreadPoints filter exists. Always validate any combination of symbol and timeframe on your own broker's data before drawing conclusions.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
What to Consider Before Using This EA
Every strategy involves trade-offs. The False Breakout Hedge has clear strengths and clear limitations, and understanding both is the point of studying it.
Strengths. It is a transparent, indicator-free system, so its logic is easy to follow and audit. Anchoring entries to fixed daily pivots and confirming with engulfing candles is a well-established price-action approach. The standout feature is its response to false breakouts: rather than simply taking the stop, it deploys a recovery hedge, which can convert a fakeout loss into a scratch or recovery when price snaps back.
Limitations. Hedging is not a magic shield. The strategy's explicit failure mode is a violent, sustained one-way trend immediately after the hedge locks — in that case both the basket stop and the individual stops are tested, and BasketSlMoney can be a meaningfully larger number than BasketTpMoney. That asymmetry means a string of clean wins can be erased by a single adverse run if parameters are not chosen carefully. Scalping also makes the strategy sensitive to spread, slippage, and commission, so live results may diverge from idealized tests. Finally, hedging accounts are not permitted by every broker or in every jurisdiction (for example, FIFO-only rules in some regions) — confirm your account supports holding both directions before testing.
The strategy may underperform in choppy, low-range sessions where breakouts repeatedly fail without following through in either direction, and in news-driven gaps that jump past pivots. Treat it as an educational framework for studying breakout confirmation and hedging — not as a finished, hands-off system.
Risk Management Tips
Sound risk management matters more than any single entry rule. As you study this EA, keep these general principles in mind:
- Size positions conservatively. A common guideline is to risk no more than 1–2% of account equity on any single idea. With a hedging basket, account for the combined exposure of both legs, not just the base leg.
- Mind the basket asymmetry. Review how
BasketTpMoney,BasketSlMoney, andHedgeMultinteract, since the loss cap can be much larger than the profit target. Make sure the worst-case basket loss is one your account can absorb. - Always test on a demo account first. Run the EA on a demo or a backtest across varied market conditions before risking real capital, and confirm your broker permits hedging.
- Understand drawdown. Even a historically sound strategy will experience losing streaks. Know the maximum drawdown you are willing to tolerate, and stop if it is exceeded.
- Keep spreads in check. Because this is a scalping approach, use the
MaxSpreadPointsfilter and a low-spread broker to avoid being eroded by transaction costs.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: FalseBreakoutHedge.ex5 (3 downloads)
- Source Code: FalseBreakoutHedge.mq5 (3 downloads)
- Documentation: FalseBreakoutHedge.pdf (3 downloads)