HedgeMasterSlave
- Experts
- Versão: 9.0
- Ativações: 7
HedgeMasterSlave is a fully automated Expert Advisor for MetaTrader 5 that trades correlated currency pairs simultaneously one as the master, one as the slave using a hedge structure that reduces directional risk compared to single-pair martingale systems.
- Correlated pair hedging
- Margin Decay Engine
- per-pair correlation filtering.
The result is a system that survived the most volatile forex event in recent history the March 2020 COVID crash without a margin call.
How It Works
Drag and drop to the GBPUSD chart only. Disable validation, set true the HMS. Have the rest of the currencys selected in the market watch window. The EA monitors two correlated currency pairs simultaneously.
When entry conditions align on the H4 Alligator and M5 Bollinger Bands, it opens a master position and a proportional(or smaller) slave position in the correlated direction. As the trade develops, it manages both positions together — scaling in with controlled martingale add-ons, protecting with a trailing stop, and partially closing the slave at high martingale levels to lock in profit before the master exits.
HedgeMasterSlave EA v9.0 — Best Settings optimized for RoboForex Pro cent account, 1:500 leverage with 800 real usd, or 80k cent (netting)
General
- Validation: False
- Take Profit (Master only): 300 pip
- Magic Master: 111001
- Magic Slave: 111002
Trailing Stop
- Trigger: 50 pip
- Distance: 40 pip
Entry Cooldown
- Min H1 candles between entries: 5
PAR1 — GBPUSD / EURGBP (negative corr −0.88)
- Use Pair 1: true
- Init Lot: 0.10
- MG Pip spacing: 105
- Master Multiplier: 3.60
- Slave Multiplier: 3.20 or 3.60
- Slave Pct: 0.80
- Max Lot: 29.0
PAR1 Slave Partial Close
- Enabled: true
- Min MG Level: 4
- Close Pct: 100%
PAR3 — USDCHF / USDCAD (positive corr +0.78)
- Use Pair 3: true
- Init Lot: 0.10
- MG Pip spacing: 88
- Master Multiplier: 3.60
- Slave Multiplier: 3.60
- Slave Pct: 0.80
- Max Lot: 29.0
PAR3 Slave Partial Close
- Enabled: true
- Min MG Level: 3
- Close Pct: 100%
Correlation Filter
- PAR1 filter: OFF
- PAR3 filter: ON
- D1 period: 50
- H4 period: 20
- Min D1 correlation: 0.70
- Min H4 correlation: 0.65
Decay Engine
- Enabled: true
- Margin Level trigger: 350%
- Decay Pct per interval: 2%
- Interval: 120 sec
Correlated Pair Hedging
Two active trading pairs run simultaneously:
-
PAR1: GBPUSD / EURGBP (negative correlation −0.88, slave trades same direction)
-
PAR3: USDCHF / USDCAD (positive correlation +0.78, slave trades opposite direction)
The hedge structure means when the market moves against PAR1, PAR3 often moves in a compensating direction — reducing combined drawdown compared to running either pair alone.
Margin Decay Engine
The most critical safety feature. When margin level drops below a configurable threshold (default 350%), the EA automatically reduces the largest open position by a small percentage every 2 minutes until margin recovers. This was triggered 44 times during the March 2020 COVID crash — and the account survived intact.
Without the Decay Engine, the same test showed the equity going negative. With it, the 2020 year closed with a $98,000 profit on a $80,000 deposit.
Correlation Filter (PAR3)
Before opening a new PAR3 trade, the EA checks the D1 correlation between USDCHF and USDCAD. If correlation has weakened below the threshold, the entry is blocked — protecting against periods when the hedge relationship breaks down.
Backtesting confirmed that enabling this filter on PAR3 reduced drawdown from 33% to 29.7% while simultaneously increasing profit — an unusual result where better risk management also improved returns.
Slave Partial Close
At configurable martingale levels, the EA automatically closes 100% of the slave position while the master remains open. This locks in the slave's accumulated profit before the trade exits — adding a meaningful secondary profit stream on top of the main trail close.
Over the 2020–2026 backtest, partial closes generated an additional $76,000 in PAR1 profit alone (8 closes averaging $9,500 each).
Trailing Stop System
All exits are managed by a trailing stop rather than a fixed take profit. Once the trade reaches the trigger threshold (default 50 pips), the stop trails at a configurable distance (default 40 pips) — letting winning trades run while protecting accumulated profit.
Controlled Martingale Scaling
Add-on positions are blocked when the next lot size would breach the MaxLot limit or when margin is insufficient.
The default multiplier of 3.6x and 105-pip spacing (PAR1) means the position sizing remains manageable across the full martingale sequence with a 2K account using 0.1lot
Settings Overview
All parameters are clearly labeled and grouped in the input panel:
-
Trailing Stop: trigger pip, trail distance
-
PAR1 Settings: MG pip spacing, lot multipliers, max lot, partial close level
-
PAR3 Settings: independent MG pip spacing, multipliers, max lot, partial close level
-
Correlation Filter: enable/disable per pair, D1 and H4 thresholds
-
Decay Engine: enable/disable, margin level trigger, lot reduction %, interval
No programming knowledge required. Default settings are optimized from 6-year backtesting and are ready to use out of the box.
Requirements
-
Platform: MetaTrader 5 (Netting mode account)
-
Symbols required: GBPUSD, EURGBP, USDCHF, USDCAD
-
Recommended deposit: $200K+ (cent account from $2000, to have enough room for the martingale engine)
-
Recommended leverage: 1:500
-
Timeframe: attach to GBPUSD H1 (EA manages all pairs internally)
-
VPS recommended for 24/5 operation
