Blog / Strategy
Strategy

Camarilla Edge Reversal Hedge

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 Camarilla Edge Reversal Hedge is a pure price-action expert advisor (EA) for MetaTrader 5 that combines Camarilla pivot points — a family of intraday support and resistance levels calculated from a rolling high, low, and close — with the classic bullish and bearish engulfing candlestick pattern. It uses no traditional indicators at all: no moving averages, no RSI, no ATR, and no VWAP. Every line it reacts to is derived directly from recent price, which makes the logic transparent and easy to study line by line.

What makes this strategy distinctive is that it blends three well-known trading "edges" into a single framework: a mean-reversion fade at the pivot band edges, a momentum breakout when price closes beyond the extreme bands, and a hedging recovery layer that can hold opposing long and short positions during the transition between those two states. It is designed for ranging-to-trending intraday conditions on liquid markets, where Camarilla pivots have traditionally been used by short-term traders to anchor reversal and breakout decisions.

As a learning tool, this EA is best suited to traders who already understand basic candlestick reading and want to study how pivot-based levels, pattern confirmation, and risk-defined order placement fit together in code. It is not a "set and forget" product — it is a worked example of how multiple classic concepts can be expressed mechanically. Because it can open hedged (simultaneous long and short) positions, it also serves as a practical illustration of how hedging accounts behave differently from netting accounts.

How It Works

The strategy evaluates its rules once per newly-closed bar on the chart timeframe, so signals do not flicker or repaint mid-candle. On each closed bar it rebuilds the Camarilla ladder from the previous Lookback bars:

It then checks for an engulfing pattern on the last two completed bars. A bullish engulfing is an up-bar that fully engulfs the prior down-bar's body; a bearish engulfing is the mirror image. With the ladder and the pattern in hand, the strategy signals one of three behaviours:

1. Engulfing Reversal (fade the band edge back toward P)

2. Breakout (ride momentum through the extreme band)

3. Hedge (the recovery layer)

Stop-loss and take-profit logic. Every distance — the touch zone, the stop buffer, and the breakout projection — is scaled by the range R, so the strategy adapts to any symbol or volatility level without hard-coded point sizes. Before any order is sent, a minimum reward:risk filter rejects setups whose target is too cramped relative to the stop. A spread filter also blocks new entries when the current spread is wider than the allowed maximum, which helps avoid entering during illiquid or news-driven conditions.

Camarilla pivot reversal MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lookback 20 5 100 Number of completed bars whose high/low/close build the Camarilla bands.
StopBufferFrac 0.10 0.02 0.50 Stop buffer beyond the H4/L4 (reversal) or H3/L3 (breakout) line, as a fraction of the lookback range R.
BreakoutProjFrac 0.50 0.10 2.00 Breakout take-profit projection beyond H4/L4, as a fraction of R.
MinRewardRisk 0.80 0.30 3.00 Minimum acceptable reward:risk ratio for any new entry.
HedgeMode 1 0 1 1 = allow a breakout leg to open while the opposite reversal leg is still live (true simultaneous hedge); 0 = only ever one position at a time.
MaxSpreadPoints 80 0 400 Skip new entries when the current spread (in points) is wider than this value.
Lots 0.10 0.01 1.00 Base lot size, normalised to the symbol's volume step and limits.
Magic 7401 0 9,999,999 Magic number used to identify and manage this EA's own trades.
Camarilla pivot reversal MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed with liquid FX majors in mind — EURUSD is the natural home of Camarilla pivot scalping — on the M5 or M15 timeframe. These shorter intraday charts are where pivot bands and engulfing confirmations are traditionally applied, and where the range-scaled distances tend to be most meaningful.

Because HedgeMode can open simultaneous long and short positions, you should run this EA on a hedging account if you want that behaviour to work as intended. On a netting account, opposite orders simply offset each other and the two role tickets collapse into one position. As always, results will vary considerably across different symbols, brokers, spreads, and market conditions, so treat the recommended settings as a starting point for study rather than a fixed prescription.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of this approach. Because the strategy is pure price action, its logic is fully transparent — there are no lagging indicator calculations to obscure why a trade fired. Camarilla pivots are a long-established intraday framework, and pairing them with an engulfing confirmation adds a pattern filter that historically helps avoid trading every minor touch of a level. The fact that all distances are scaled by the range R means the same settings can adapt across instruments of different volatility, and the built-in reward:risk and spread filters add a layer of discipline that many discretionary approaches lack.

Known limitations. Pivot-reversal systems can struggle in strongly trending markets, where price runs straight through the H3/L3 fade lines without rejecting — exactly the scenario the hedge layer attempts to manage, but hedging is a risk-transfer mechanism, not a guarantee of recovery. Engulfing patterns are common and not all of them lead to follow-through, so false signals are an inherent part of any pattern-based system. The hedge logic also assumes a hedging-capable account; on a netting account it behaves quite differently. Finally, breakout entries placed on a close beyond an extreme band may experience slippage during fast moves, and the spread filter only blocks new entries — it does not protect open positions.

Where it may underperform. Choppy, low-volatility sessions can produce small ranges where the bands sit close together and the reward:risk filter rejects most setups, leading to few or no trades. Conversely, violent news-driven moves can blow through both the fade stop and the breakout target faster than the per-bar logic can react. Studying these edge cases on a demo account is the most valuable way to understand the strategy's behaviour.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Consider these general principles as you study any automated strategy:

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

← Back to Blog