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 Pivot Boundary Reclaim Scalp Hedge is a pure price-action expert advisor (EA) for MetaTrader 5 that combines classic floor-trader pivot levels with a two-bar engulfing candlestick pattern and a resting hedge order. It uses no technical indicators at all — no moving averages, no RSI, no ATR, no Bollinger Bands. Every decision is built directly from raw price bars, which makes the logic transparent and easy to study line by line.
At its core, this is a failed-breakout reversal scalping strategy. Pivot points are price levels mathematically derived from the previous day's high, low, and close, and traders watch them because breakouts through these levels often fail and snap back. The strategy is designed to "fade" those false breakouts: when price pierces a pivot and then reverses with a confirming engulfing candle, the EA enters a short, fast trade (a "scalp") aiming for the next pivot. To survive the times when a breakout turns out to be real, it simultaneously places an opposite stop order as a hedge.
As a learning tool, this EA suits intermediate traders who want to understand how pivot levels, candlestick confirmation, hedging, and basket money management fit together in a single mechanical system. It is best viewed as a study in structure-based trading rather than a shortcut — the value is in seeing how each component reduces, but never eliminates, the risk of the trade.
How It Works
The strategy builds its own daily pivot ladder on the fly by aggregating the chart's primary-timeframe bars into UTC calendar days. When a day completes, it freezes that day's High, Low, and Close and computes the textbook pivot ladder, then holds it static for the next session (a non-repainting design).
The pivot levels are calculated as:
- P (central pivot) = (High + Low + Close) / 3
- R1 = 2P − Low, R2 = P + (High − Low)
- S1 = 2P − High, S2 = P − (High − Low)
These are sorted into an ascending ladder: S2, S1, P, R1, R2.
Entry conditions — the strategy signals a trade when:
- For a short: the last two bars pierce a resistance pivot (P, R1, or R2) from below, but the closing bar is a bearish engulfing candle that closes back below the level. This suggests the upside breakout failed, so the EA sells the rejection.
- For a long: price pierces a support pivot (P, S1, or S2), but the closing bar is a bullish engulfing candle that reclaims the level. This suggests the downside breakout failed, so the EA buys the rejection.
- A two-bar engulfing pattern means the signal candle's body fully covers the prior candle's body in the opposite direction — a common reversal confirmation.
- The setup must also clear a minimum reward:risk filter, so cramped trades with too little room to the target are skipped.
Take-profit logic: the target is always a real structural pivot — the next inner pivot in the direction of the trade. This makes it a clean "pivot-to-pivot" scalp rather than an arbitrary distance.
Stop-loss logic: the scalp's stop sits just beyond the rejected extreme (the high for a short, the low for a long), buffered by a fraction of the prior day's range.
The hedge: the moment the scalp is placed, the EA drops an opposite stop order at the pierced extreme — a buy stop above a short, or a sell stop below a long. This hedge sits closer than the scalp's own stop. If the breakout was genuine, the hedge triggers first, the scalp's wider stop later bows out, and the hedge can ride the real move toward the next outer pivot. A whipsaw loss may then become a hedged scratch.
Basket money management: whenever any exposure is open, the EA watches the combined floating profit/loss of all legs on every tick. It banks the entire basket at BasketTpMoney and flattens everything at BasketSlMoney. This is the dominant exit while hedged — it harvests a recovered whipsaw and caps the main failure mode, which is a hard one-way trend after the hedge fills.
Because every distance is scaled by the prior day's range, the logic adapts to different symbols and timeframes without hard-coded point values.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| StopBufferFrac | 0.12 | 0.02 | 0.60 | Distance of the scalp stop beyond the rejected extreme, as a fraction of the prior day's range. Larger values give the scalp more breathing room. |
| HedgeOffsetFrac | 0.04 | 0.00 | 0.30 | How far inside the scalp's stop the hedge trigger sits (fraction of day range). Kept below StopBufferFrac so the hedge fills before the scalp's stop. |
| MinRewardRisk | 1.00 | 0.30 | 3.00 | Minimum acceptable reward:risk ratio (target ÷ stop) for the reversal scalp. Higher values reject tighter, lower-quality setups. |
| BasketTpMoney | 25.0 | 5.0 | 2000.0 | Bank the whole basket once floating profit reaches this amount (account currency). |
| BasketSlMoney | 300.0 | 50.0 | 100000.0 | Flatten the whole basket once floating loss reaches this amount (account currency). |
| MaxSpreadPoints | 80 | 0 | 500 | Skip new entries while the spread (in points) is wider than this. Set to 0 to disable the filter. |
| Lots | 0.10 | 0.01 | 1.00 | Order volume for each leg (scalp and hedge). |
| Magic | 7340 | 0 | 9999999 | Magic number used to identify and manage this EA's own orders. |

Recommended Chart Settings
This strategy was designed for a liquid FX major such as EURUSD or GBPUSD, traded on the M5 or M15 timeframe — the natural home of pivot false-breakout scalping, where tight spreads and frequent tests of intraday levels occur. The day-range scaling means the same code can be applied to other symbols and timeframes, but you should expect the behavior to change with each market's volatility and spread profile. Results will vary across different market conditions, and a setting that historically suited one pair may not suit another.
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
Strengths of this approach. The logic is fully mechanical and indicator-free, so there is nothing to repaint and nothing hidden — you can audit exactly why each trade fires. Pivot levels are widely watched, which is part of why false breakouts around them are common. The structural take-profit (pivot-to-pivot) and the hedge concept are thoughtful attempts to give a fade trade a survival mechanism rather than a single hard stop.
Known limitations. Fading breakouts is inherently a counter-trend tactic, and the documented failure mode is a strong, sustained one-way trend after the hedge fills — exactly the environment where mean-reversion struggles. Hedging also means you may briefly hold two opposing positions, which ties up margin and can incur extra spread and swap costs. Because the strategy can run a basket of legs, the BasketSlMoney figure is the real risk ceiling per cycle, and it should be sized against your account, not left at default. Pivot false-breakout scalping also depends on tight spreads; widening spreads around news or rollover can erode the small per-trade edge a scalp relies on.
When it may underperform. Choppy-to-ranging conditions around pivots historically favor this style, while trending breakouts, low-liquidity sessions, and high-spread instruments may indicate a poorer fit. Always study its behavior on your specific broker, symbol, and account before drawing conclusions.
Risk Management Tips
- Position sizing: keep the
Lotsvalue conservative relative to your account, and remember the hedge can double your open volume during a locked phase. - Per-trade exposure: a common educational guideline is to risk no more than 1–2% of account equity on any single idea. Use
BasketSlMoneyand your lot size together to keep the worst-case basket loss within that range. - Demo first: run the EA on a demo account for an extended period across varied market conditions before considering any live capital.
- Understand drawdown: even a sound mechanical system experiences losing streaks. Know the maximum drawdown you can tolerate emotionally and financially before you start.
- Review regularly: monitor spread behavior, swap costs, and how often the hedge leg fills, and adjust parameters only with a clear, tested reason.
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: PivotBoundaryReclaimScalpHedge.ex5 (3 downloads)
- Source Code: PivotBoundaryReclaimScalpHedge.mq5 (3 downloads)
- Documentation: PivotBoundaryReclaimScalpHedge.pdf (3 downloads)