Custom MQL5 XAUUSD M5 Breakout EA with News Filter & Trailing

MQL5 Asesores Expertos

Tarea técnica

# Technical Specification: GoldGuardian Institutional Breakout EA (MQL5)

## 1. Project Overview
Develop an institutional-grade, low-latency Expert Advisor (EA) in **MQL5** for MetaTrader 5, specifically engineered for **XAUUSD (Gold)** on the **M5 timeframe**. The EA executes confirmed range breakouts aligned with higher-order trend filters while enforcing strict capital preservation, partial profit taking, dynamic trailing, Friday market-close protection, mobile push notifications, and an integrated MQL5 Economic Calendar news filter.

*Note: All optimized parameters listed below MUST be hardcoded as the default input values inside the `.mq5` source code so the EA runs out-of-the-box without requiring external `.set` preset files.*

---

## 2. Core Strategy Logic & Entry Rules

### A. Dynamic Range Box Calculation & Quality Filter
* **Lookback Period (`InpBoxLookback` = 12):** Calculate the highest high (`BoxHigh`) and lowest low (`BoxLow`) over the preceding 12 closed candles (bars `2` to `13`), excluding the most recently closed signal candle (bar `1`).
* **Box Size Quality Filter (`InpMinBoxPoints` = 150 | `InpMaxBoxPoints` = 1500):** Ignore breakouts if the 12-bar box height is too narrow (dead market) or excessively wide (exhausted move).
* **Visual Monitor:** Draw a clean, non-repainting rectangle on the chart displaying active box boundaries and an on-chart status dashboard (Spread, Daily P/L, Active Session Status, News Filter Countdown).

### B. Trend & Volatility Filters
* **Trend Alignment:** Fast EMA (`InpFastEMA` = 50) and Slow EMA (`InpSlowEMA` = 200) applied to `PRICE_CLOSE`.
  * **Buy Bias:** `Close > FastEMA` AND `FastEMA > SlowEMA`.
  * **Sell Bias:** `Close < FastEMA` AND `FastEMA < SlowEMA`.
* **Volatility Measurement:** ATR (`InpATR_Period` = 14) on bar `1`.

### C. Confirmed Breakout Execution (Bar Close Only)
* Evaluate entry conditions strictly **once per new bar open** (using closed bar `1` data):
  * **Long Entry:** `Buy Bias` is true AND `Close > BoxHigh` AND `Close <= BoxHigh`.
  * **Short Entry:** `Sell Bias` is true AND `Close < BoxLow` AND `Close >= BoxLow`.
* Maximum of **1 open position** at any time per Magic Number.

---

## 3. Trade Management: Partial Profit, Break-Even & Price Trailing

1. **Initial Stop Loss (`InpSL_ATR_Mult` = 2.4):** Set at `2.4 * ATR(14)` from entry price.
2. **Partial Take Profit (`InpUsePartialTP` = true | `InpTP1_RR` = 1.5 | `InpPartialClosePct` = 50%):**
   * When profit reaches `1.5 * SL Distance`, automatically close **50% of the position volume** to bank realized profits (respecting broker `SYMBOL_VOLUME_MIN` and `SYMBOL_VOLUME_STEP`).
3. **Fast Break-Even Lock (`InpBE_TriggerRR` = 0.8 | `InpBE_ProfitPoints` = 50):**
   * Once unrealized profit reaches `0.8 * SL Distance`, move SL to `Entry Price +/- 50 points` to guarantee a risk-free runner.
4. **Dynamic Price Trailing (`InpTrail_StartRR` = 1.5 | `InpTrail_DistATR` = 1.2):**
   * For the remaining runner volume, once profit reaches `1.5 * SL Distance`, trail the SL dynamically at `1.2 * ATR(14)` behind current market price (ratcheting SL strictly in the profitable direction on every tick).

---

## 4. Capital Preservation, News Filter & Market Close Protection

1. **Dynamic Position Sizing (`InpTotalRiskPercent` = 1.5%):**
   * Calculate lot size automatically based on account balance and exact SL distance so a full SL hit never exceeds `1.5%` of equity.
2. **Hard Daily Loss Circuit Breaker (`InpMaxDailyLossPct` = 3.0%):**
   * Track daily starting equity at `00:00` server time. If combined floating + closed daily loss hits `3.0%`, close all open EA positions immediately and suspend new entries until the next trading day.
3. **Over-Trading Safeguard (`InpMaxTradesPerDay` = 3):**
   * Restrict the EA to a maximum of 3 executed trades per calendar day to prevent consecutive whipsaw losses during choppy markets.
4. **Built-in MQL5 Economic Calendar News Filter (`InpUseNewsFilter` = true):**
   * Utilize native MQL5 `CalendarValueHistory()` functions (no external DLLs required) to monitor **High-Impact USD news events** (NFP, FOMC, CPI, Interest Rate decisions).
   * Halt new trade entries **`InpMinsBeforeNews` = 30 minutes** before and **`InpMinsAfterNews` = 30 minutes** after high-impact USD releases.
   * Optional parameter (`InpCloseBeforeNews` = false) to close open trades prior to major news.
5. **Friday Pre-Market Close Liquidation (`InpCloseOnFriday` = true | `InpFridayCloseHour` = 21 | `InpFridayCloseMin` = 30):**
   * Automatically close all open EA positions and halt new entries every **Friday at `21:30` Server Time** to eliminate weekend gap risk and late-session spread spikes.
6. **Session Time Filter & Spread Guard:**
   * Restrict new entries between `InpStartHour = 9` and `InpEndHour = 18` (Broker Server Time).
   * Block execution if spread exceeds `InpMaxSpreadPoints = 350`.
7. **Mobile Push Notifications (`InpSendNotifications` = true):**
   * Send native MT5 mobile push notifications (`SendNotification()`) upon trade entry, partial profit/break-even activation, Friday close, or daily loss circuit breaker trigger.

---

## 5. Technical & Delivery Requirements for Developer

1. **Broker-Agnostic Execution:** Auto-detect 2/3-digit Gold quotes, symbol suffixes (`XAUUSD`, `XAUUSD.m`, `GOLD`), and broker filling modes (`IOC`, `FOK`, `RETURN`) to prevent `Error 10030`.
2. **VPS Restart Resilience:** Persist daily drawdown tracking in `GlobalVariables` so VPS reboots do not reset protection limits.
3. **Strategy Tester Compatibility:** Ensure the News Filter gracefully bypasses or handles historical simulation so `Every tick based on real ticks` backtesting runs smoothly without errors.
4. **Deliverables:** Full, clean `.mq5` source code (`0 errors`, `0 warnings`) + compiled `.ex5` file.

Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
(408)
Proyectos
527
24%
Arbitraje
62
58% / 24%
Caducado
60
11%
Trabaja
2
Desarrollador 2
Evaluación
(22)
Proyectos
28
7%
Arbitraje
9
33% / 33%
Caducado
1
4%
Trabaja
3
Desarrollador 3
Evaluación
(5)
Proyectos
5
0%
Arbitraje
5
0% / 40%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(1)
Proyectos
2
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 19 ejemplos
5
Desarrollador 5
Evaluación
(216)
Proyectos
284
20%
Arbitraje
28
61% / 14%
Caducado
0
Trabaja
6
Desarrollador 6
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
7
Desarrollador 7
Evaluación
(2)
Proyectos
3
33%
Arbitraje
0
Caducado
2
67%
Libre
8
Desarrollador 8
Evaluación
(642)
Proyectos
750
35%
Arbitraje
50
52% / 38%
Caducado
14
2%
Trabaja
9
Desarrollador 9
Evaluación
(268)
Proyectos
319
74%
Arbitraje
16
75% / 0%
Caducado
6
2%
Trabaja
10
Desarrollador 10
Evaluación
(568)
Proyectos
866
61%
Arbitraje
33
27% / 45%
Caducado
24
3%
Libre
Ha publicado: 1 ejemplo
11
Desarrollador 11
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
12
Desarrollador 12
Evaluación
(11)
Proyectos
18
17%
Arbitraje
3
0% / 67%
Caducado
3
17%
Trabaja
13
Desarrollador 13
Evaluación
(190)
Proyectos
204
47%
Arbitraje
4
50% / 25%
Caducado
1
0%
Trabaja
14
Desarrollador 14
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
15
Desarrollador 15
Evaluación
(7)
Proyectos
6
0%
Arbitraje
4
25% / 75%
Caducado
2
33%
Libre
16
Desarrollador 16
Evaluación
(2)
Proyectos
3
33%
Arbitraje
0
Caducado
2
67%
Trabaja
17
Desarrollador 17
Evaluación
(4)
Proyectos
11
55%
Arbitraje
1
100% / 0%
Caducado
0
Libre
18
Desarrollador 18
Evaluación
(2)
Proyectos
2
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
19
Desarrollador 19
Evaluación
(30)
Proyectos
37
38%
Arbitraje
0
Caducado
2
5%
Trabaja
Ha publicado: 1 ejemplo
20
Desarrollador 20
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 3 ejemplos
21
Desarrollador 21
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 2 ejemplos
22
Desarrollador 22
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
23
Desarrollador 23
Evaluación
(319)
Proyectos
574
35%
Arbitraje
84
31% / 44%
Caducado
207
36%
Trabaja
24
Desarrollador 24
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 2 ejemplos
25
Desarrollador 25
Evaluación
(2680)
Proyectos
3432
68%
Arbitraje
78
49% / 14%
Caducado
343
10%
Trabaja
Ha publicado: 1 ejemplo
26
Desarrollador 26
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
27
Desarrollador 27
Evaluación
(24)
Proyectos
35
40%
Arbitraje
9
22% / 33%
Caducado
5
14%
Trabajando
Ha publicado: 9 artículos, 35 ejemplos
28
Desarrollador 28
Evaluación
(1)
Proyectos
1
100%
Arbitraje
0
Caducado
0
Trabaja
Ha publicado: 7 ejemplos
29
Desarrollador 29
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
30
Desarrollador 30
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
31
Desarrollador 31
Evaluación
(45)
Proyectos
58
33%
Arbitraje
12
42% / 42%
Caducado
7
12%
Libre
Solicitudes similares
I want full experience devloper need , I want devlope 4 Type Bot , Grd strategy 2 , and other bias strategy 2 scaning on market condition choose one order buy or sell and take profit and target fully automatic management, I am explain full details on private chat only experience developer contact me
Hello, I want to clarify that my project is specifically for TradingView only. I am looking for an experienced TradingView Pine Script developer (Pine Script v5/v6) to develop advanced custom technical indicators. I am NOT looking for MT4, MT5, MQL4, MQL5, Expert Advisors (EAs), or automated trade execution. 1. Indicators I want developed A. Smart Money Concepts (SMC) - Buy-side and sell-side liquidity sweeps
Hello everyone, I am a final-year AI & Data Science student interested in building a career in algorithmic trading and EA development. I have good technical knowledge of MQL5, MT5 Expert Advisors, risk management, technical indicators, and automated trading strategies. I have also worked on building trading systems using Machine Learning and Neural Networks. I know how to develop EAs and trading strategies, but I am
Hello! I don't have time, but I bought some challanges and honestly I don't feel 100% confident yet for trading, I am eager to share prop firm account with good, profitable trader. 50% of profits are your, but first I need to make selection, I need to trust you somehow that you will not blow up account within few days. Only serious persons please, please don't waste me time and yours
Hello, I'm looking for a developer who can build an automated trading bot (Expert Advisor) for MetaTrader 5 (MT5). I want a smart trading robot that can scan the markets, identify high-probability trading opportunities, and automatically execute trades. Strategies and indicators I'd like included: RSI (75 overbought / 25 oversold). MACD crossover with strong momentum. 9/21 EMA crossover. 20/50 SMA crossover. Smart
I am looking for a GOLD (XAUUSD) SCALPING idea that still makes money after realistic costs. I will test it myself on real FTMO tick data before paying for any code. What I need in your application (written, no files): Exact entry and exit rules: timeframe (ticks, M1 or M5), time of day, stop, target, max holding time, spread filter. Why it should work: who is on the other side of the trade. If you have them: results
Delete/Remove . Integrate Support & Resistance . Prop Firm Expert. (Expert is Active With a firm's account) . (Tick Volume) spikes specifically when price interacts with pre-defined Support and Resistance zones. [ required ]
i need a good bot which can scalp and have a tight stop loss an advance bot with a two position only and alot size should be 0.02 AI Trading Bot Development Prompt Build a fast, precision-based scalping trading bot designed to capture small price movements in the market while maintaining strict risk management. 1. Trading Strategy Develop a scalping strategy focused on quick entries and exits. Trade only when
I am looking for an experienced MQL5 developer to create a simple, well-organized Expert Advisor for MetaTrader 5. Requirements: - Provide complete and editable MQL5 source code. - Explain the EA's functionality and logic clearly. - Include configurable settings. - Include appropriate risk-control features. - Provide clear installation and testing instructions. - Ensure the code is clean and properly documented. I
PROJECT NAME: BALISA AI VERSION 1.0 I want to develop my own automated trading robot called Balisa AI for MetaTrader 5 (MT5). REQUIREMENTS: 1. The robot must support Forex and Gold (XAUUSD). 2. It must operate as an Expert Advisor (EA) on MT5. 3. It must automatically identify trading opportunities and execute buy and sell orders. 4. It must have Stop Loss and Take Profit. 5. It must include risk management to

Información sobre el proyecto

Presupuesto
150+ USD

Cliente

Encargos realizados1
Número de arbitrajes0