Custom MQL5 XAUUSD M5 Breakout EA with News Filter & Trailing

MQL5 Experts

Termos de Referência

# 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.

Arquivos anexados:

Respondido

1
Desenvolvedor 1
Classificação
(408)
Projetos
527
24%
Arbitragem
62
58% / 24%
Expirado
60
11%
Trabalhando
2
Desenvolvedor 2
Classificação
(22)
Projetos
28
7%
Arbitragem
9
33% / 33%
Expirado
1
4%
Trabalhando
3
Desenvolvedor 3
Classificação
(5)
Projetos
5
0%
Arbitragem
5
0% / 40%
Expirado
0
Livre
4
Desenvolvedor 4
Classificação
(1)
Projetos
2
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 19 códigos
5
Desenvolvedor 5
Classificação
(216)
Projetos
284
20%
Arbitragem
28
61% / 14%
Expirado
0
Trabalhando
6
Desenvolvedor 6
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
7
Desenvolvedor 7
Classificação
(2)
Projetos
3
33%
Arbitragem
0
Expirado
2
67%
Livre
8
Desenvolvedor 8
Classificação
(642)
Projetos
750
35%
Arbitragem
50
52% / 38%
Expirado
14
2%
Trabalhando
9
Desenvolvedor 9
Classificação
(268)
Projetos
319
74%
Arbitragem
16
75% / 0%
Expirado
6
2%
Trabalhando
10
Desenvolvedor 10
Classificação
(568)
Projetos
866
61%
Arbitragem
33
27% / 45%
Expirado
24
3%
Livre
Publicou: 1 código
11
Desenvolvedor 11
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
12
Desenvolvedor 12
Classificação
(11)
Projetos
18
17%
Arbitragem
3
0% / 67%
Expirado
3
17%
Trabalhando
13
Desenvolvedor 13
Classificação
(190)
Projetos
204
47%
Arbitragem
4
50% / 25%
Expirado
1
0%
Trabalhando
14
Desenvolvedor 14
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
15
Desenvolvedor 15
Classificação
(7)
Projetos
6
0%
Arbitragem
4
25% / 75%
Expirado
2
33%
Livre
16
Desenvolvedor 16
Classificação
(2)
Projetos
3
33%
Arbitragem
0
Expirado
2
67%
Trabalhando
17
Desenvolvedor 17
Classificação
(4)
Projetos
11
55%
Arbitragem
1
100% / 0%
Expirado
0
Livre
18
Desenvolvedor 18
Classificação
(2)
Projetos
2
0%
Arbitragem
1
0% / 100%
Expirado
0
Livre
19
Desenvolvedor 19
Classificação
(30)
Projetos
37
38%
Arbitragem
0
Expirado
2
5%
Trabalhando
Publicou: 1 código
20
Desenvolvedor 20
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 3 códigos
21
Desenvolvedor 21
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 2 códigos
22
Desenvolvedor 22
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
23
Desenvolvedor 23
Classificação
(319)
Projetos
574
35%
Arbitragem
84
31% / 44%
Expirado
207
36%
Trabalhando
24
Desenvolvedor 24
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 2 códigos
25
Desenvolvedor 25
Classificação
(2680)
Projetos
3432
68%
Arbitragem
78
49% / 14%
Expirado
343
10%
Trabalhando
Publicou: 1 código
26
Desenvolvedor 26
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
27
Desenvolvedor 27
Classificação
(24)
Projetos
35
40%
Arbitragem
9
22% / 33%
Expirado
5
14%
Carregado
Publicou: 9 artigos, 35 códigos
28
Desenvolvedor 28
Classificação
(1)
Projetos
1
100%
Arbitragem
0
Expirado
0
Trabalhando
Publicou: 7 códigos
29
Desenvolvedor 29
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
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

Informações sobre o projeto

Orçamento
150+ USD

Cliente

Pedidos postados1
Número de arbitragens0