Gold Magic Hand
- エキスパート
-
Guo Ji Wang
各位好!我是一名专注于 MT5 自动化策略开发 的量化研究员。与传统的指标组合不同,我的研究重点在于市场微观结构与统计学背离。
我的研究方向:
多品种统计套利: 利用算法实时监测强相关品种(如金/银、主流币对)的统计背离,捕捉均值回归机会。
形态识别系统: 基于 6000 根以上历史 K 线进行动态相似度匹配,寻找历史高概率走势。
风控管理: 开发了完善的移动止损与动态仓位管理系统,确保策略在剧烈波动环境下的稳定性。
我坚信交易是概率与逻辑的博弈。如果你也在研究如何通过 MQL5 实现更智能的交易决策,希望我们能碰撞出火花。 - バージョン: 1.0
- アクティベーション: 5
## 1. Strategy Overview
Gold Magic Hand is an automated trading Expert Advisor (EA) designed for MetaTrader 5, primarily targeting the XAUUSD (Gold) market on the M1 timeframe. The core strategy integrates a **dynamic mathematical curve channel model** with **adaptive layered entry** and **progressive position scaling**.
### Key Mechanisms
| Component | Description |
|---|---|
| **Dynamic Channel Model** | Utilizes a proprietary mathematical model to construct time-dependent expanding curve channels based on multi-dimensional market variables. Entry signals are generated when price action interacts with the upper and lower channel boundaries. |
| **Adaptive Layered Entry** | Positions are deployed in a structured layered framework, with each new entry triggered only when price deviates beyond a configured threshold from existing position levels, ensuring optimal entry distribution. |
| **Progressive Position Scaling** | Position sizing follows a progressive scaling algorithm that adjusts exposure based on market structure depth, dynamically amplifying recovery potential in alignment with market conditions. |
| **Intelligent Close Logic** | - **Independent side optimization**: When position depth is within threshold, each direction closes independently upon reaching configured profit targets. - **Global portfolio close**: When position depth exceeds threshold and account metrics meet configured criteria, all positions are liquidated simultaneously for optimal capital protection. |
| **Daily Regime Lock** | Once a global portfolio close event is triggered within a trading day, the system enters a protective lock-down state for the remainder of the day. This restriction automatically resets at the start of the next session. |
---
## 2. Usage Instructions
### 2.1 Installation
1. Copy the compiled EA file `GoldMagicHand_v1.0_english.ex5` to your MetaTrader 5 terminal:
- Navigate to **File → Open Data Folder**
- Place the file in `MQL5/Experts/`
2. Restart MetaTrader 5 or refresh the Navigator panel.
> **Note**: The `.ex5` file is the compiled executable — it can be used directly without MetaEditor or source code.
### 2.2 Attaching to Chart
1. Open an **XAUUSD M1** chart.
2. Drag the EA from the Navigator panel onto the chart.
3. In the properties dialog, configure the input parameters (see below).
4. Ensure **"Allow Algo Trading"** is enabled in the toolbar.
### 2.3 Input Parameters
#### Position & Entry Parameters
| Parameter | Default | Description |
|---|---|---|
| `InpM1Timeframe` | PERIOD_M1 | Strategy signal calculation timeframe |
| `InpMaxPositions` | 3 | Position depth threshold for activating global close logic |
| `InpMaxLongOrders` | 25 | Maximum number of long positions allowed |
| `InpMaxShortOrders` | 25 | Maximum number of short positions allowed |
#### Scaling & Risk Management
| Parameter | Default | Description |
|---|---|---|
| `InpLotSize` | 0.01 | Base position size (for validation; initial entry uses broker minimum) |
| `InpMartingale` | 1.30 | Progressive scaling coefficient — each new position scales by this factor |
| `InpGridDistance` | 50 | Minimum deviation threshold (in points) between entry layers |
| `InpMaxSpread` | 1000 | Maximum allowed spread (in points) — openings are blocked above this |
| `InpMagicNumber` | 20260823 | Unique identifier for this EA's positions |
#### Closing Parameters
| Parameter | Default | Description |
|---|---|---|
| `InpClosePoints` | 200.0 | Independent side average profit target (points) |
| `InpCloseProfit` | 10.0 | Independent side floating profit target (account currency) |
| `InpAllCloseProfit` | 10.0 | Portfolio-level equity deviation threshold to trigger global close |
| `InpExecutionInterval` | 0 | Minimum interval between strategy cycles in seconds (0 = every new bar) |
### 2.4 Chart Display
Upon initialization, the EA:
- Displays a gold "Gold Magic Hand v1.0" label at the top-left corner of the chart.
- Applies a clean candlestick chart style (no grid lines, no period separators, with right margin shift).
---
## 3. Account Requirements
### ⚠️ CRITICAL: Hedging Account Required
This EA **simultaneously holds both long and short positions** on the same symbol. This is a **hedging strategy** and requires:
- ✅ **Hedging account** (netting accounts will NOT work — positions will offset each other instead of coexisting)
- ✅ Account type must be set to **"Hedging"** in your broker's account settings
> **How to check**: In MT5, go to **Tools → Options → Trade** and verify the position accounting method is **Hedging**, not Netting.
### Minimum Capital
| Requirement | Value |
|---|---|
| Minimum account balance/equity | **2,000 USD** (or equivalent) |
The EA performs a balance check at startup and will automatically remove itself if equity is below 2,000.
### Recommended Starting Approach
> 💡 **Start with a cent account first!**
> Given the high-risk nature of this strategy, it is strongly recommended to first test on a **cent account** (or micro account) with small capital to observe behavior, understand drawdown patterns, and validate the strategy before committing larger funds.
---
## 4. Risk Warnings
### ⚠️ HIGH-RISK STRATEGY — READ CAREFULLY
**This EA is classified as a high-frequency, high-risk trading system.** The following risk factors are inherent to the strategy:
### 4.1 Progressive Scaling Risk
- The progressive scaling coefficient (default 1.3x) causes position sizes to **grow exponentially** with each additional entry layer.
- Example with base lot 0.01 and coefficient 1.3:
| Position # | Lot Size | Cumulative Lots |
|---|---|---|
| 1 | 0.01 | 0.01 |
| 5 | 0.03 | 0.09 |
| 10 | 0.11 | 0.41 |
| 15 | 0.34 | 1.27 |
| 20 | 1.07 | 4.19 |
| 25 | 3.36 | 13.64 |
- At maximum capacity (25 long + 25 short), the total exposure becomes **extremely large**.
### 4.2 Hedging / Drawdown Risk
- The strategy holds **opposing positions simultaneously**, which means:
- Floating losses accumulate on one or both sides during ranging markets.
- The combined floating loss can become **very significant** before the take-profit threshold is reached.
- There is **no stop-loss** — positions rely entirely on the average-profit closing mechanism.
### 4.3 Layered Entry Risk in Trending Markets
- In a strong one-directional trend without pullbacks, the layered entry mechanism will keep adding counter-trend positions with increasing sizes, leading to:
- Rapidly growing floating losses
- Potential margin calls or stop-outs
- The EA has **no hard stop-loss** protection
### 4.4 Spread Risk
- While there is a maximum spread filter, during high-volatility events (NFP, FOMC, etc.), spreads can widen dramatically, potentially:
- Causing entries at unfavorable prices
- Preventing timely exits
### 4.5 Liquidity & Slippage Risk
- Large accumulated position sizes may face slippage during closing, especially during low-liquidity periods or volatile events.
---
## 5. Disclaimer
### NO GUARANTEE OF PROFIT
**This software is provided "AS IS" without any warranties of any kind, either expressed or implied.** Past performance is not indicative of future results.
1. **Trading in financial markets involves substantial risk of loss** and is not suitable for every investor. The high degree of leverage available can work against you as well as for you.
2. **This EA employs a progressive scaling hedging strategy** which can result in **total loss of your account balance**. You must be fully aware of and accept this risk before use.
3. The author, distributor, and any affiliated parties shall **NOT be held liable** for any trading losses, account blow-ups, margin calls, or any financial damages arising from the use of this EA, whether direct, indirect, incidental, or consequential.
4. **You are solely responsible** for your trading decisions. Always:
- Test thoroughly on demo accounts before live trading
- Use only capital you can afford to lose entirely
- Monitor the EA actively — do not leave it unattended on live accounts
5. This EA does **not constitute financial advice, investment advice, or a recommendation** to trade in any particular way.
6. The strategy parameters provided are **default values only**. You are responsible for adjusting them to suit your risk tolerance, broker conditions, and market environment.
7. **By using this software, you acknowledge and accept all risks associated with its operation**, including the possibility of complete loss of funds.
---
## 6. Quick Start Checklist
- [ ] Confirm your account is a **Hedging account** (not Netting)
- [ ] Account equity ≥ **2,000 USD** (or equivalent)
- [ ] **Test on a demo or cent account first**
- [ ] Attach EA to **XAUUSD M1** chart
- [ ] Review and adjust input parameters before enabling
- [ ] Enable **"Allow Algo Trading"** in MT5
- [ ] Monitor the EA regularly, especially during major news events
- [ ] Have a plan for manual intervention if needed
