MT5 Forex Hedge Intervention EA

Замовник: AI | Опубліковано: 16.01.2026

I need a compact, well-commented MQL5 expert advisor that quietly monitors my primary XAUUSD robot and jumps in only when a position slides into drawdown. The logic is simple: place a single hedge, hunt for a quick +5 pip recovery, then step out of the way. Core behaviour • Trigger the hedge when either a user-defined % or $ drawdown threshold is hit (I want the flexibility to set one or both). • One hedge only—no grids, no pyramids. If price overshoots the drawdown limit after the first hedge closes, the EA must be able to place one fresh hedge, never multiple layers. • Exit the hedge as soon as it pockets 5 pips, or when the underlying position’s drawdown has subsided below the threshold. • Option switch: once the hedge is active, either freeze the primary EA’s trades or allow it to keep running; I want to decide that per setup. • Calendar filter: automatically pause all hedge activity during FED rate decisions and Non-Farm Payroll, then resume when the volatility window passes. Key settings to expose in the inputs – Drawdown % trigger – Drawdown $ trigger – Time filter for the +5 pip exit window – Re-hedge enable/disable – Primary EA pause/continue toggle – Event pause start/stop minutes Deliverables 1. Full MQL5 source code (.mq5) written clearly enough for future integrations. 2. Compiled .ex5 ready for live deployment. 3. Basic user guide outlining parameter meanings and recommended values. Please build with standard MT5 functions—no external DLLs. After delivery I’ll run the EA on a demo account and expect identical behaviour to the spec above before releasing the milestone. More feature extensions are on the horizon, so clean, modular code is essential.