指定
# H4 Zone Retest EA (MQL5)
An automated trading Expert Advisor (EA) for MetaTrader 5, developed in MQL5.
The EA trades gold (XAUUSD) using a multi-timeframe breakout and retest strategy: it defines the first H4 candle of each day as a trading zone, detects breakouts on the M5 chart, waits for a retest, and executes trades with risk management, trailing stops, and optional news filtering.
---
## Features
- H4 → M5 breakout and retest trading logic
- Configurable fixed lot or risk-based position sizing
- Trailing stop management
- **Smart news filter** that avoids trading around high-impact events
- Spread and terminal safety checks
- Dynamic lot calculation based on risk percentage
## Strategy Overview
1. **Zone identification (H4)**
The EA marks the first H4 candle of the current day and stores its high and low as the trading zone boundaries.
2. **Breakout detection (M5)**
On each new M5 candle:
- A bullish breakout occurs when the candle closes above `zoneHigh`.
- A bearish breakout occurs when the candle closes below `zoneLow`.
When a breakout occurs, the EA starts waiting for a retest.
3. **Retest entry**
- If price returns to the broken zone within a specified window (`MaxWaitSeconds`):
- **Buy** on bullish retest → SL = breakout candle low, TP = 1.5 × risk distance.
- **Sell** on bearish retest → SL = breakout candle high, TP = 1.5 × risk distance.
- Uses either a fixed lot (`Lots`) or a risk-based lot (`UseRiskPercent`, `RiskPercent`).
4. **Trade management and protection**
- Trailing stop control (`UseTrailingStop`, `TrailingStart`, `TrailingStep`).
- Spread and trade-permission checks (`MaxSpreadPoints`, `TERMINAL_TRADE_ALLOWED`).
- **Built-in news filter**: the EA checks the MetaTrader 5 economic calendar (`CalendarValueHistory`) and automatically avoids opening new trades within the defined window around **high-impact news events** for a selected currency (`NewsFilterCurrency`, `NewsFilterMinutes`).
- This filter helps prevent entries during volatile periods and improves stability during major market announcements.
## Input Parameters
| Parameter | Description | Default |
|------------|-------------|----------|
| `Lots` | Fixed lot size per trade | 0.01 |
| `UseRiskPercent` | Enable dynamic lot sizing by risk | false |
| `RiskPercent` | Percent of balance risked per trade | 1.0 |
| `MaxWaitSeconds` | Maximum time allowed for retest | 86400 |
| `UseTrailingStop` | Enable trailing stop | true |
| `TrailingStart` | Profit (points) before trailing begins | 200 |
| `TrailingStep` | Distance (points) of trailing stop | 100 |
| `UseNewsFilter` | Enable high-impact news filter | true |
| `NewsFilterMinutes` | Minutes before/after news to avoid trading | 30 |
| `MagicNumber` | Unique identifier for EA positions | 202503 |
---
## Requirements
- MetaTrader 5 platform
- Broker supporting XAUUSD (gold) trading
- MQL5 environment (MetaEditor)
- Historical data for backtesting
---
## Installation
1. Open **MetaEditor** → *File → Open Data Folder*
2. Copy the `.mq5` file into `MQL5/Experts/`
3. Compile the EA
4. In MetaTrader 5, open *Navigator → Expert Advisors*
5. Attach the EA to a **XAUUSD** chart
6. Adjust input parameters as needed
---
## Backtest
**Symbol:** XAUUSD
**Timeframe:** M5
**Period:** Jan 2024 – Apr 2026
**Model:** Every tick (MetaTrader 5 Strategy Tester)
### Notes
- Default parameters were used unless otherwise stated.
- The test includes realistic spreads and commissions.
- Results are for research and educational purposes only and do not guarantee future performance.
応答済み
1
評価
プロジェクト
519
24%
仲裁
61
57%
/
25%
期限切れ
60
12%
仕事中
2
評価
プロジェクト
647
53%
仲裁
35
63%
/
20%
期限切れ
7
1%
仕事中
3
評価
プロジェクト
1
0%
仲裁
0
期限切れ
1
100%
暇
4
評価
プロジェクト
184
25%
仲裁
25
16%
/
76%
期限切れ
16
9%
暇
5
評価
プロジェクト
12
33%
仲裁
0
期限切れ
2
17%
仕事中
パブリッシュした人: 1 code
6
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
7
評価
プロジェクト
16
38%
仲裁
0
期限切れ
1
6%
取り込み中
8
評価
プロジェクト
53
57%
仲裁
2
100%
/
0%
期限切れ
1
2%
暇
パブリッシュした人: 5 codes
9
評価
プロジェクト
8
38%
仲裁
2
50%
/
50%
期限切れ
2
25%
暇
10
評価
プロジェクト
4
0%
仲裁
0
期限切れ
0
暇
11
評価
プロジェクト
21
29%
仲裁
2
50%
/
0%
期限切れ
4
19%
仕事中
12
評価
プロジェクト
4
25%
仲裁
0
期限切れ
0
暇
13
評価
プロジェクト
33
18%
仲裁
6
50%
/
33%
期限切れ
4
12%
暇
14
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
15
評価
プロジェクト
10
10%
仲裁
0
期限切れ
0
暇
16
評価
プロジェクト
8
0%
仲裁
2
50%
/
0%
期限切れ
1
13%
仕事中
17
評価
プロジェクト
478
40%
仲裁
105
40%
/
24%
期限切れ
82
17%
取り込み中
パブリッシュした人: 2 codes
18
評価
プロジェクト
21
24%
仲裁
0
期限切れ
2
10%
暇
パブリッシュした人: 3 codes
19
評価
プロジェクト
14
43%
仲裁
0
期限切れ
3
21%
暇
20
評価
プロジェクト
309
76%
仲裁
14
71%
/
0%
期限切れ
6
2%
取り込み中
21
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
22
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
23
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
24
評価
プロジェクト
0
0%
仲裁
1
0%
/
100%
期限切れ
0
暇
25
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
26
評価
プロジェクト
74
18%
仲裁
30
17%
/
53%
期限切れ
31
42%
暇
27
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
28
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
29
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
30
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
31
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
32
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
33
評価
プロジェクト
1
0%
仲裁
0
期限切れ
0
暇
パブリッシュした人: 11 codes
34
評価
プロジェクト
1
0%
仲裁
0
期限切れ
0
暇
パブリッシュした人: 2 codes
35
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
36
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
類似した注文
Optimizing martingale EA and specific stressdays
50 - 125 USD
Hello, I am looking for someone who can optimize my personal Martingale EA and perform thorough backtesting, especially on stress days and periods of high market volatility. A few important details: The EA trades XAUUSD (Gold) on the 1-minute timeframe (M1) . I use 1:500 leverage with TMGM as my broker. The account size is €50,000 . The EA already includes a News Filter and several other safety features. I need Low
can you help me use a Tickblaze Algo NRBO on the NT platform? I have it somewhat set up, but I have other questions about running it & knowing how to operate it in NT. Thank you if anyone have experience in this kindly bib and let do it asap
I need a fully automated custom Expert Advisor for MetaTrader 5 (MQL5). The EA is intended for use on a The5ers $100,000 2-Step prop-firm account. IMPORTANT DELIVERY REQUIREMENT: I must receive the complete editable .mq5 source code as well as the compiled .ex5 file. Compiled-only delivery is NOT acceptable. The EA must be coded specifically for this project and must not copy trades, use external trading signals or
I've got a Pine Script from Trading View. I need help from a programmer who can help with optimising the strategy by 1) Adding a couple of further rules 2) Redesign the trading alert arrows & colours I need, please, a programmer who is 1) Good at Pine language 2) Has excellent after-job support (not for free though) 3) Possess the ability to work with others. 4) Able to deliver the job at the shortest possible time
I need a trading system similar to the attached files. Check attachment for details on the indicator. i guess the indicator contains some of (Rainbow MA , MTF Dashboard , Symbol Switcher , and Trend Histogram), though may not be exactly as listed
I am looking for an experienced MQL5 developer to build a professional MT5 Expert Advisor specifically for XAUUSD (Gold) and other indices. I saw that XAUUSD is one of your primary areas of specialization, so I would like to discuss a custom EA with you. My priority is NOT extremely high returns. I want a robust EA designed for controlled risk and long-term survival. Requirements: • MT5 / MQL5 • XAUUSD, usoil,btc and
VENOM EA
35 - 50 USD
So, im a beginner and I'm pleading you to built me a bot that runs 24hrs and that can buy and sell at the same time, choose a better and profitable strategy. I will do anything thing it takes to get the bot. I hope you take my request into consideration
I have an existing working MQL5 Expert Advisor and require an experienced MQL5 programmer/trading-system analyst to independently analyse its historical performance. This is NOT initially a request to rewrite the EA or simply optimize parameters. Current strategy: - MetaTrader 5 - M15 timeframe - EMA / ADX / ATR based - Approximately 1,337 historical trades - Gross Profit approximately USD 271,000 - Gross Loss
Overview I am looking for an experienced MQL5 developer to design and deliver a professional Expert Advisor for MetaTrader 5. Rather than dictating the strategy, I want the developer to propose a proven, well-documented approach they have personally built and validated — one with a genuine statistical edge, not curve-fitted results. Quality and transparency matter more than speed of delivery. Budget is negotiable for
Zwivhuya
100+ USD
I would like to be part of this trade because i want to help my family out of the hopeless life we are living now . i thoughts going to school will help me get better job but no i am still sitting for us to eat at home i have to sell my body to someone and get pay with that small money i can buy bread and cooldrink for my family that we can not sleep with emyter stomach
プロジェクト情報
予算
30+ USD
締め切り
最高 10 日