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 Fade Hedge strategy is a pure price-action expert advisor (EA) for MetaTrader 5 that combines two classic intraday concepts: floor pivot points and the engulfing candlestick pattern. It uses no traditional indicators at all — no moving averages, no RSI, no ATR, no Bollinger Bands, and no VWAP. Instead, it works directly from raw daily price levels and the shape of the most recently closed candle.
A "floor pivot" is the central price level that intraday desks calculate from the prior day's high, low, and close. From it, the strategy derives the standard support and resistance bands — PP (the pivot), R1, R2, S1, and S2. The thesis behind the system is mean reversion: on many sessions, price rotates back and forth between the first support (S1) and first resistance (R1) around the central pivot. When a candle pushes into a support or resistance band and is firmly rejected by an engulfing candle — one whose body completely overwhelms the prior candle's body — the strategy reads that as the level holding, and it "fades" (trades against) the move back toward the central pivot.
This EA is best understood as a learning tool for traders who want to study how pivot levels, candlestick rejection patterns, and pending-order hedging interact. Its signature feature is that every fade is protected from the moment it opens: a resting stop order is pre-placed just beyond the level, so on the days when a level genuinely breaks rather than holds, the losing fade is automatically converted into a hedged breakout basket. It is suitable for intermediate traders comfortable with the idea of hedging and basket-level money management, and it is designed for liquid, range-prone intraday instruments.
How It Works
The strategy recalculates its daily pivot levels once per completed calendar day, building them from the chart's own bars (no second timeframe is ever read). It then evaluates each freshly closed candle for a rejection setup.
Daily pivot calculation (recomputed each new day):
PP = (High + Low + Close) / 3of the prior dayR1 = 2 × PP − LowandS1 = 2 × PP − HighR2 = PP + (High − Low)andS2 = PP − (High − Low)- The prior day's range (
High − Low) scales every buffer and distance, so the system adapts to any symbol or timeframe without hard-coded pip values.
The strategy signals a LONG fade when:
- The just-closed candle is a bullish engulfing pattern (a green candle whose body fully engulfs the prior red candle's body, and whose body is at least
EngulfFactortimes the prior body). - That candle's low tagged the S1 (or optionally S2) support zone, but its close finished back above the level.
- The close is still below the central pivot PP, leaving room to scalp upward toward it.
The strategy signals a SHORT fade when:
- The just-closed candle is a bearish engulfing pattern (a red candle engulfing the prior green candle).
- That candle's high tagged the R1 (or optionally R2) resistance zone, but its close finished back below the level.
- The close is still above PP, leaving room to scalp downward toward it.
The hedge — the signature mechanic:
- At the exact moment a fade is opened, a resting stop order is dropped a buffer beyond the faded level (a SellStop below support for a long, a BuyStop above resistance for a short), tagged with a separate magic number.
- If price keeps moving against the fade and breaks the level, the stop fills automatically — the position is now hedged and positioned to ride the breakout in the new direction.
Exit logic:
- Scalp take-profit: The fade targets the central pivot PP (capped by the
ScalpTpFracdistance). If it reaches that target, the trade closes and the stale resting hedge is cancelled. - Stop-loss: Each fade carries a stop-loss placed just beyond the hedge trigger, so the hedge always arms first if price breaks the level.
- Basket money management (once the hedge is live): When the hedge fills, individual targets give way to net floating profit/loss. If the combined floating result reaches
BasketTpMoney, everything closes. If it falls to−BasketSlMoney, the whole basket is flattened as a hard ceiling against a violent trend.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| ZoneFrac | 0.12 | 0.02 | 0.60 | Width of the pivot zone the rejection candle must reach, as a fraction of the day's range. |
| EngulfFactor | 1.10 | 1.00 | 3.00 | Engulfing strength — the signal candle's body must be at least this multiple of the prior candle's body. |
| ScalpTpFrac | 0.50 | 0.10 | 2.00 | Scalp take-profit distance toward PP, as a fraction of the day range (capped at PP itself). |
| HedgeOffsetFrac | 0.10 | 0.02 | 0.60 | How far beyond the faded level the resting hedge stop sits, as a fraction of the range. |
| HedgeTpFrac | 0.80 | 0.20 | 3.00 | The hedge leg's breakout take-profit, as a fraction of the day range. |
| StopFrac | 0.30 | 0.05 | 2.00 | Extra fade stop-loss pad placed beyond the hedge trigger, as a fraction of the range. |
| UseOuterLevels | 1 | 0 | 1 | Use the outer R2/S2 levels in addition to R1/S1 as fade zones (1 = on, 0 = off). |
| HedgeVolFactor | 1.50 | 0.50 | 3.00 | Hedge lot size as a multiple of the base lots (above 1 over-covers the losing fade). |
| BasketTpMoney | 25.0 | 5.0 | 2000.0 | Close the entire basket once net floating profit reaches this amount (account currency). |
| BasketSlMoney | 300.0 | 50.0 | 100000.0 | Flatten the entire basket once net floating loss reaches this amount (account currency). |
| MaxSpreadPoints | 40 | 0 | 500 | Skip new entries while the spread (in points) exceeds this value (0 = off). |
| Lots | 0.10 | 0.01 | 1.00 | Base fade lot size. |
| Magic | 5240 | 0 | 9,999,999 | Base magic number identifying the EA's trades (the hedge uses Magic + 1). |

Recommended Chart Settings
The Pivot Fade Hedge strategy was designed for liquid, range-prone intraday instruments where price tends to rotate around the daily pivots — for example EUR/USD, GBP/USD, or XAU/USD (gold) on the M5, M15, or M30 timeframes. Because the pivot levels are rebuilt from the prior calendar day, the system needs at least one full prior day of bar history before it can begin trading.
Keep in mind that results will vary considerably across different market conditions. A symbol that respects its pivots in quiet, ranging sessions can behave very differently during high-impact news or strong trending days. Always test any symbol and timeframe combination on historical data and a demo account before considering it further.
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 the approach. The strategy is built on two well-documented price-action concepts — floor pivots and engulfing rejections — making it transparent and easy to study. Because every distance scales to the prior day's range, it adapts to different symbols and volatility without manual pip tuning. The pre-placed hedge is its most distinctive educational feature: it demonstrates how a resting pending order can convert a failed mean-reversion trade into a structured breakout position rather than a simple loss.
Known limitations. Fading levels is fundamentally a mean-reversion approach, and its classic failure mode is the strong trend day — the session that simply marches through a level instead of respecting it. The hedge is designed for exactly that case, but hedging is not a free lunch: a choppy market that repeatedly whipsaws across a level can fill the hedge, reverse, and leave both legs working against each other until the basket stop is reached. Spread widening, slippage, and broker-specific stop-level restrictions can also affect how the fade and hedge orders are placed. Because the EA holds two opposing positions at once when hedged, you should also confirm your broker and jurisdiction permit hedging accounts.
When it may underperform. Expect weaker behavior during persistent trends, around major economic releases, and on instruments or sessions that do not rotate around their pivots. The basket money-management figures (BasketTpMoney and BasketSlMoney) are denominated in account currency, so they must be matched carefully to your lot size and account size — defaults that suit a small account could be far too tight or too loose on another.
Risk Management Tips
Sound risk management matters far more than any single entry rule. Consider these general principles:
- Position sizing: Risk only a small, fixed fraction of your account on any single setup — many educators suggest no more than 1–2% per trade. With a hedged basket, account for the combined exposure of both legs, not just the fade.
- Use a demo account first: Test the strategy on a demo account across many weeks and varied market conditions before risking real capital.
- Understand drawdown: Every strategy experiences losing streaks. Know the maximum drawdown you are willing to tolerate and set
BasketSlMoneyand your overall account stop accordingly. - Match money settings to your account: Because basket exits are measured in currency, recalibrate
BasketTpMoneyandBasketSlMoneywhenever you change lot size or account balance. - Avoid over-optimization: Parameters that look perfect on past data often fail forward. Favor robust, sensible settings over curve-fitted extremes.
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: PivotFadeHedge.ex5 (3 downloads)
- Source Code: PivotFadeHedge.mq5 (3 downloads)
- Documentation: PivotFadeHedge.pdf (3 downloads)