Custom MQL5 XAUUSD M5 Breakout EA with News Filter & Trailing

MQL5 Uzmanlar

Şartname

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

Dosyalar:

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(408)
Projeler
527
24%
Arabuluculuk
62
58% / 24%
Süresi dolmuş
60
11%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(22)
Projeler
28
7%
Arabuluculuk
9
33% / 33%
Süresi dolmuş
1
4%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(5)
Projeler
5
0%
Arabuluculuk
5
0% / 40%
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 19 kod
5
Geliştirici 5
Derecelendirme
(216)
Projeler
284
20%
Arabuluculuk
28
61% / 14%
Süresi dolmuş
0
Çalışıyor
6
Geliştirici 6
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
7
Geliştirici 7
Derecelendirme
(2)
Projeler
3
33%
Arabuluculuk
0
Süresi dolmuş
2
67%
Serbest
8
Geliştirici 8
Derecelendirme
(642)
Projeler
750
35%
Arabuluculuk
50
52% / 38%
Süresi dolmuş
14
2%
Çalışıyor
9
Geliştirici 9
Derecelendirme
(268)
Projeler
319
74%
Arabuluculuk
16
75% / 0%
Süresi dolmuş
6
2%
Çalışıyor
10
Geliştirici 10
Derecelendirme
(568)
Projeler
866
61%
Arabuluculuk
33
27% / 45%
Süresi dolmuş
24
3%
Serbest
Yayınlandı: 1 kod
11
Geliştirici 11
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
12
Geliştirici 12
Derecelendirme
(11)
Projeler
18
17%
Arabuluculuk
3
0% / 67%
Süresi dolmuş
3
17%
Çalışıyor
13
Geliştirici 13
Derecelendirme
(190)
Projeler
204
47%
Arabuluculuk
4
50% / 25%
Süresi dolmuş
1
0%
Çalışıyor
14
Geliştirici 14
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Geliştirici 15
Derecelendirme
(7)
Projeler
6
0%
Arabuluculuk
4
25% / 75%
Süresi dolmuş
2
33%
Serbest
16
Geliştirici 16
Derecelendirme
(2)
Projeler
3
33%
Arabuluculuk
0
Süresi dolmuş
2
67%
Çalışıyor
17
Geliştirici 17
Derecelendirme
(4)
Projeler
11
55%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
0
Serbest
18
Geliştirici 18
Derecelendirme
(2)
Projeler
2
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
19
Geliştirici 19
Derecelendirme
(30)
Projeler
37
38%
Arabuluculuk
0
Süresi dolmuş
2
5%
Çalışıyor
Yayınlandı: 1 kod
20
Geliştirici 20
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 3 kod
21
Geliştirici 21
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 2 kod
22
Geliştirici 22
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
23
Geliştirici 23
Derecelendirme
(319)
Projeler
574
35%
Arabuluculuk
84
31% / 44%
Süresi dolmuş
207
36%
Çalışıyor
24
Geliştirici 24
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 2 kod
25
Geliştirici 25
Derecelendirme
(2680)
Projeler
3432
68%
Arabuluculuk
78
49% / 14%
Süresi dolmuş
343
10%
Çalışıyor
Yayınlandı: 1 kod
26
Geliştirici 26
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
27
Geliştirici 27
Derecelendirme
(24)
Projeler
35
40%
Arabuluculuk
9
22% / 33%
Süresi dolmuş
5
14%
Yüklendi
Yayınlandı: 9 makale, 35 kod
28
Geliştirici 28
Derecelendirme
(1)
Projeler
1
100%
Arabuluculuk
0
Süresi dolmuş
0
Çalışıyor
Yayınlandı: 7 kod
29
Geliştirici 29
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Benzer siparişler
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

Proje bilgisi

Bütçe
150+ USD

Müşteri

Verilmiş siparişler1
Arabuluculuk sayısı0