VWAP + RSI Divergence EA with Martingale (MT4)

작업 종료됨

실행 시간 2 일
고객의 피드백
Hands down, AGI is the best developer I've ever worked with. He understands needs, delivers beyond expectations, and communicates perfectly. Simply outstanding – I'm in the best hands!
피고용인의 피드백
Tested every build himself on a real account and reported back with precision. Spotted a signal edge case before I did. Patient while travelling. Rare client, would work with him again.

명시

## 🎯 **Project Overview**

I need an **Expert Advisor (EA)** for **MetaTrader 4** that combines signals from a **VWAP indicator** (provided) with **RSI Divergence detection** and includes a **Martingale function** for averaging losing positions. The EA should execute trades when **BOTH** indicators confirm the same direction.

---

## 📊 **Indicators Used**

### 1. VWAP Indicator (Custom)
- **File:** `VWAP_MT4_Gold_Ultimate 2d.mq4` (provided)
- **Buffer Structure:**
  - Buffer 0: VWAP Line
  - Buffer 1: Upper Band
  - Buffer 2: Lower Band
  - Buffer 3: Buy Arrows (`0.0` = no signal, `>0.0` = arrow)
  - Buffer 4: Sell Arrows (`0.0` = no signal, `>0.0` = arrow)

### 2. RSI Divergence (Standard RSI)
- **Type:** Built-in `iRSI()` indicator
- **Divergence Types Required:**
  - **Regular Bullish:** Price makes lower low, RSI makes higher low
  - **Regular Bearish:** Price makes higher high, RSI makes lower high
  - **Hidden Divergences** (optional)
- **Detection:** Swing high/low pivots in RSI

### 3. Divergence Strength Calculation
The EA calculates a divergence strength score from 0 to 100 based on the following factors:

- **Price swing size (20% weight):** The magnitude of the price movement between the two pivot points, normalized by ATR
- **RSI swing size (20% weight):** The magnitude of the RSI movement between the two pivot points
- **Divergence difference (40% weight):** The difference between price and RSI movement directions
- **Trend strength (10% weight):** Based on ADX value
- **RSI context (10% weight):** Bonus if RSI is in overbought/oversold territory

A divergence is considered valid only when its calculated strength is greater than or equal to `MinDivergenceStrength`.

---

## 📈 **Entry Logic**

### Signal Timing: `SignalAtBarClose = true`
- **All signals are evaluated at bar close** (prevents repainting). If set to false, signals are evaluated immediately, which may cause repainting and unreliable backtest results. Use with caution.

### First Entry Signal
A **first trade** is opened when **BOTH** conditions are met on the **same bar**:

#### BUY Signal (LONG)
1. **VWAP:** Green BUY arrow appears (Buffer 3 > 0)
2. **RSI:** Bullish divergence detected

#### SELL Signal (SHORT)
1. **VWAP:** Red SELL arrow appears (Buffer 4 > 0)
2. **RSI:** Bearish divergence detected

---

## 📊 **Martingale Function**

### Concept
When a trade (BUY or SELL) is in loss, **additional trades in the same direction** are opened to improve the average entry price.

### Martingale Entry Conditions
Each Martingale trade requires **TWO conditions**:
1. **Pip Distance:** Price has moved `MartingalePipStep` pips against the position
2. **Signal Confirmation:** One of three modes (user-selectable)

### Martingale Signal Modes

| Mode | Description | Buy Signal | Sell Signal |
|------|-------------|------------|-------------|
| **0** | **Pips Only** | Pip step reached | Pip step reached |
| **1** | **Pips + VWAP Band** | Pip step reached AND price at lower VWAP band | Pip step reached AND price at upper VWAP band |
| **2** | **Pips + RSI Level** | Pip step reached AND RSI < Oversold Level | Pip step reached AND RSI > Overbought Level |

### Martingale Exit Logic
When the **weighted net profit of all open trades in the same direction** reaches `MartingaleMinProfitPips` pips:
- **ALL trades in that direction are closed immediately**

The weighted net profit is calculated as the sum of (pips profit or loss × lot size) for each individual trade. This ensures that larger positions have a greater impact on the closing decision, reflecting the true monetary profit or loss of the combined positions.

### Example (BUY):
```
InitialLotSize = 0.01
MartingaleMultiplier = 1.5
MartingalePipStep = 50
MartingaleMaxTrades = 3
MartingaleMinProfitPips = 20

Trade 1 Buy: 0.01 @ 1.2000
→ Martingale triggered at 1.1950 (-50 pips)
Trade 2 Buy: 0.015 @ 1.1950
→ Martingale triggered at 1.1900 (-50 pips)
Trade 3 Buy: 0.0225 @ 1.1900

At 1.1960:
- Trade 1: -40 pips × 0.01 = -0.4
- Trade 2: +10 pips × 0.015 = +0.15
- Trade 3: +60 pips × 0.0225 = +1.35
- Net = +1.10 (≈ 20 pips profit in weighted terms)

→ ALL trades close at 1.1960!
```

---

## ⚙️ **Full Parameter List**

### 1. VWAP Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `VWAP_ResetPeriod` | Reset period (0=H1,1=H4,2=Daily,3=Weekly,4=Monthly) | 2 |
| `VWAP_StdDevDist` | Band distance in standard deviations | 2.0 |
| `VWAP_ArrowOffset` | Arrow offset in points | 150 |
| `VWAP_UseRealVolume` | Use real volume if available | false |

### 2. RSI Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `RSI_Period` | RSI period | 14 |
| `RSI_Overbought` | Overbought level | 70 |
| `RSI_Oversold` | Oversold level | 30 |
| `PivotStrength` | Pivot detection strength (bars left/right) | 2 |
| `MinPivotDistance` | Minimum distance between pivots in bars | 5 |

### 3. Divergence Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `EnableRegularDivergence` | Enable regular divergence detection | true |
| `EnableHiddenDivergence` | Enable hidden divergence detection | false |
| `MinDivergenceStrength` | Minimum divergence strength (0-100). Only divergences with a strength >= this value are considered valid signals. | 50 |

### 4. Signal Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `SignalAtBarClose` | Evaluate signals at bar close (recommended to prevent repainting) | true |
| `SignalTimeframe` | Timeframe for signal detection | PERIOD_H4 |
| `TradeTimeframe` | Timeframe for trade execution | PERIOD_H4 |

### 5. Lot Size Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `InitialLotSize` | Initial lot size for first trade | 0.01 |

### 6. Martingale Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `MartingaleEnabled` | Enable Martingale | false |
| `MartingaleMaxTrades` | Maximum number of Martingale trades per direction | 3 |
| `MartingalePipStep` | Pip distance between Martingale trades | 50 |
| `MartingaleMultiplier` | Lot multiplier per step | 1.5 |
| `MartingaleMinProfitPips` | Minimum profit in pips to close all trades | 20 |
| `MartingaleRequiresSignal` | Martingale trade requires signal confirmation | true |
| `MartingaleSignalMode` | Signal mode (0=Pips only, 1=Pips+VWAP, 2=Pips+RSI) | 1 |
| `MartingaleMaxTotalLossPips` | Maximum loss in pips for Martingale positions | 200 |

### 7. Order Management Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `StopLossPips` | Stop loss in pips | 50 |
| `TakeProfitPips` | Take profit in pips | 100 |
| `TrailingStopPips` | Trailing stop in pips (0 = disabled) | 0 |
| `OrderComment` | Order comment | "VWAP Divergence" |
| `MagicNumber` | Unique Magic Number | 20260817 |

### 8. Safety Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `MaxSpread` | Maximum spread in points | 30 |
| `MaxSlippage` | Maximum slippage in points | 10 |
| `MaxTotalLoss` | Maximum total loss in account currency (EA STOPS COMPLETELY) | 500 |
| `MaxTradesPerDirection` | Maximum open trades per direction (excluding Martingale) | 1 |

### 9. Display Settings
| Parameter | Description | Default |
|-----------|-------------|---------|
| `ShowDivergenceLines` | Draw divergence lines on chart | true |
| `ShowSignalArrows` | Draw signal arrows on chart | true |
| `ShowInfoPanel` | Show info panel on chart | true |

---

## 🛠️ **Technical Requirements**

### Platform
- **MetaTrader 4 ONLY** (not MT5)
- Compatible with Windows 10/11

### Performance & Stability
- **NO repainting** of signals
- Use `iCustom()` to read VWAP indicator signals
- All parameters must be **optimizable** in Strategy Tester
- **Error handling** with `GetLastError()`
- **Logging** in Experts tab
- The EA must be stable and must not freeze MT4 even during periods of high volatility or when processing many historical bars. The developer should review the VWAP indicator code to ensure it runs efficiently without changing its layout or functionality.

### Code Quality
- **Modular structure:**
  - Signal Engine (VWAP + RSI)
  - Divergence Engine (Pivot detection)
  - Trade Manager (Order open/close)
  - Martingale Manager
  - Risk Manager (MaxLoss monitoring)
- `#property strict` required

- Well-commented code

  • The EA must be stable and must not freeze MT4 even during periods of high volatility or when processing many historical bars

  • The developer is expected to review and optimize the VWAP indicator code for performance without changing its layout or functionality. The indicator currently uses nested loops which may cause performance issues with large history. The developer should implement necessary optimizations to ensure smooth operation while preserving the indicator's visual appearance and signal logic.

  • The EA is primarily designed for XAUUSD (Gold)

  • All pip calculations, stop loss, take profit, Martingale steps, and profit targets must work correctly for XAUUSD

  • XAUUSD has a specific pip value (0.01 for 5-digit brokers) and the EA must handle this correctly

  • All parameters related to pips (StopLossPips, TakeProfitPips, MartingalePipStep, MartingaleMinProfitPips, MartingaleMaxTotalLossPips) must be calculated and applied correctly for this instrument

  • The developer must ensure that  Point  and pip calculations are properly handled for XAUUSD's decimal places


---

## 🛑 **Safety Features**

| Feature | Description |
|---------|-------------|
| **MaxTotalLoss** | If total loss reaches this amount, EA **STOPS ALL TRADING** permanently (until manually reactivated) |
| **MartingaleMaxTotalLossPips** | If Martingale positions reach this loss in pips, all Martingale trades close (EA continues trading) |

**No restrictions:** No `MaxTradesPerDay` restriction. No "only one position per direction" restriction beyond standard Martingale logic (Martingale requires multiple positions).

---

## 📦 **Delivery Requirements**

1. **Source Code:** `.mq4` file
2. **Compiled File:** `.ex4` file
3. **Parameter Set:** Optimized `.set` file
4. **User Guide:** PDF with all parameters explained (in English)
5. **Bugfix Support:** 14 days after delivery
6. **Installation Instructions:** Step-by-step guide

---

## 🔧 **Sample Logic (Pseudocode)**

```mql4
// MARTINGALE SIGNAL LOGIC
if (MartingaleRequiresSignal) {
    switch (MartingaleSignalMode) {
        case 0: // Pips Only
            martingaleSignal = true;
            break;
            
        case 1: // Pips + VWAP Band
            if (direction == BUY) {
                martingaleSignal = (close[i] <= VWAP_LowerBand[i]);
            } else {
                martingaleSignal = (close[i] >= VWAP_UpperBand[i]);
            }
            break;
            
        case 2: // Pips + RSI Level
            if (direction == BUY) {
                martingaleSignal = (RSI[i] < RSI_Oversold);
            } else {
                martingaleSignal = (RSI[i] > RSI_Overbought);
            }
            break;
    }
} else {
    martingaleSignal = true;
}

// ENTRY CONDITIONS
if (MartingaleEnabled && IsLossPosition() && martingaleSignal) {
    OpenMartingaleTrade();
}
```

---

## 📝 **Summary of Martingale Modes**

| Mode | Description | Best For |
|------|-------------|----------|
| **0** | Pips only | Aggressive traders, fast averaging |
| **1** | Pips + VWAP Band | Conservative traders, institutional support/resistance |
| **2** | Pips + RSI Level | Traders who want oversold/overbought confirmation |

---

## 💰 **Budget & Timeline**

- **Budget:** Please provide your quote
- **Timeline:** 2-7 days expected
- **Payment:** MQL5 escrow terms

---

## 📧 **Application Requirements**

Please include in your proposal:
1. **Estimated timeline** and delivery date
2. **Your experience** with Martingale EAs and divergence detection in MT4
3. **Confirmation** that you work with MT4 (not MT5)
4. **Any questions** or clarifications needed
5. **Examples** of similar EAs you have developed

---

## 📎 **Attachment**
- `VWAP_MT4_Gold_Ultimate 2d.mq4` (provided)

---

**Ready to hire!** 🚀
**Platform:** MetaTrader 4 ONLY

**Budget:** Open to negotiation


*********TO ALL APPLICANTS: I am currently on vacation and will be offline for a few hours but will get back to each of you soon again. Thank you so much for applying I will let you know soon and make a decision. Looking forward to working with you.*********

응답함

1
개발자 1
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
2
개발자 2
등급
(111)
프로젝트
184
25%
중재
25
16% / 76%
기한 초과
16
9%
무료
3
개발자 3
등급
(401)
프로젝트
519
24%
중재
61
57% / 25%
기한 초과
60
12%
로드됨
4
개발자 4
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
5
개발자 5
등급
(22)
프로젝트
28
7%
중재
9
33% / 33%
기한 초과
1
4%
작업중
6
개발자 6
등급
(75)
프로젝트
99
57%
중재
5
80% / 20%
기한 초과
5
5%
로드됨
7
개발자 7
등급
(17)
프로젝트
21
19%
중재
5
40% / 40%
기한 초과
0
무료
8
개발자 8
등급
(62)
프로젝트
90
29%
중재
24
13% / 58%
기한 초과
7
8%
작업중
9
개발자 9
등급
(631)
프로젝트
739
34%
중재
49
53% / 39%
기한 초과
15
2%
작업중
10
개발자 10
등급
(1)
프로젝트
1
0%
중재
0
기한 초과
0
무료
게재됨: 3 코드
11
개발자 11
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
12
개발자 12
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
13
개발자 13
등급
(25)
프로젝트
31
13%
중재
14
0% / 79%
기한 초과
9
29%
무료
14
개발자 14
등급
(10)
프로젝트
12
33%
중재
0
기한 초과
2
17%
작업중
게재됨: 1 코드
15
개발자 15
등급
(2)
프로젝트
2
0%
중재
1
0% / 100%
기한 초과
0
무료
16
개발자 16
등급
(3)
프로젝트
9
67%
중재
0
기한 초과
0
작업중
17
개발자 17
등급
(212)
프로젝트
275
21%
중재
25
52% / 16%
기한 초과
0
로드됨
18
개발자 18
등급
(184)
프로젝트
198
46%
중재
4
50% / 25%
기한 초과
1
1%
작업중
19
개발자 19
등급
(1)
프로젝트
1
0%
중재
1
0% / 100%
기한 초과
0
무료
20
개발자 20
등급
(12)
프로젝트
19
32%
중재
0
기한 초과
1
5%
작업중
21
개발자 21
등급
(13)
프로젝트
31
23%
중재
8
25% / 63%
기한 초과
5
16%
무료
22
개발자 22
등급
(11)
프로젝트
11
0%
중재
5
20% / 60%
기한 초과
2
18%
무료
23
개발자 23
등급
(54)
프로젝트
67
42%
중재
15
27% / 60%
기한 초과
1
1%
로드됨
24
개발자 24
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
25
개발자 25
등급
(6)
프로젝트
8
38%
중재
2
50% / 50%
기한 초과
2
25%
무료
26
개발자 26
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
27
개발자 27
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
28
개발자 28
등급
(64)
프로젝트
145
46%
중재
21
38% / 24%
기한 초과
32
22%
무료
29
개발자 29
등급
(34)
프로젝트
35
40%
중재
0
기한 초과
3
9%
무료
30
개발자 30
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
게재됨: 1 코드
31
개발자 31
등급
(4)
프로젝트
7
57%
중재
1
100% / 0%
기한 초과
0
무료
32
개발자 32
등급
(6)
프로젝트
8
38%
중재
1
0% / 100%
기한 초과
0
무료
33
개발자 33
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
34
개발자 34
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
35
개발자 35
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
게재됨: 1 코드
36
개발자 36
등급
(559)
프로젝트
853
61%
중재
33
27% / 45%
기한 초과
24
3%
무료
게재됨: 1 코드
37
개발자 37
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
38
개발자 38
등급
(10)
프로젝트
17
18%
중재
2
0% / 50%
기한 초과
3
18%
로드됨
39
개발자 39
등급
(1)
프로젝트
1
0%
중재
0
기한 초과
0
무료
40
개발자 40
등급
(7)
프로젝트
6
0%
중재
4
25% / 75%
기한 초과
2
33%
무료
41
개발자 41
등급
(170)
프로젝트
203
47%
중재
5
20% / 60%
기한 초과
3
1%
무료
42
개발자 42
등급
(78)
프로젝트
246
74%
중재
7
100% / 0%
기한 초과
1
0%
무료
게재됨: 1 기고글
43
개발자 43
등급
(61)
프로젝트
83
45%
중재
27
11% / 70%
기한 초과
8
10%
무료
44
개발자 44
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
게재됨: 2 코드
45
개발자 45
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
46
개발자 46
등급
(45)
프로젝트
53
57%
중재
2
100% / 0%
기한 초과
1
2%
무료
게재됨: 5 코드
47
개발자 47
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
48
개발자 48
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
49
개발자 49
등급
(271)
프로젝트
553
50%
중재
57
40% / 37%
기한 초과
227
41%
작업중
50
개발자 50
등급
(263)
프로젝트
309
76%
중재
15
67% / 0%
기한 초과
6
2%
로드됨
51
개발자 51
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
52
개발자 52
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
53
개발자 53
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
54
개발자 54
등급
(4)
프로젝트
8
0%
중재
3
33% / 67%
기한 초과
4
50%
무료
55
개발자 55
등급
(298)
프로젝트
478
40%
중재
105
40% / 24%
기한 초과
82
17%
로드됨
게재됨: 2 코드
56
개발자 56
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
Hello, I’d like to develop an AI-powered analysis dashboard for , with a clear, easy-to-use design that works on mobile and web, or on the platform we agree on. I’d like it to include: Main dashboard: Show the market status, the latest data update, and the current signal, if available, including direction, entry price, stop loss, targets, and risk-to-reward ratio. AI signal explanations: Explain in clear language why
Scalping bort 30+ USD
GOLD SCALPING BOT STRATEGY Symbol: XAUUSD (Gold vs USD) Broker: Exness Account: Standard Starting Balance: $20 1. TIMEFRAME - Trend analysis: M15. - Entry timeframe: M5. - Trade only when the market has a clear direction. 2. INDICATORS - EMA 50 - EMA 200 - RSI 14 - Support and Resistance 3. BUY RULES The bot must open a BUY trade only when all these conditions are met: 1. EMA 50 is above EMA 200 on M15. 2. Price is
Hello, I am looking for an experienced MQL5 developer to create a professional, reliable, fully customizable Expert Advisor (EA) and trading signal system for MetaTrader 5. 1. Supported Markets The EA must support: Gold (XAUUSD) Silver (XAGUSD) Nasdaq 100 (NAS100/US100) Forex currency pairs Bitcoin (BTCUSD) It must work with MT5 brokers, including Tickmill, where these instruments are available. 2. Two Trading Modes
Entry Strategy: Explain exact conditions for opening a trade specific indicators like Moving Averages or RSI, time of day, or price action rules. Exit Strategy: Define when a trade should closeTake Profit, Stop Loss, Trailing Stop, or indicator signals. Daily Trading Rules: Specify daily limits if applicable maximum trades per day, specific trading hours, or maximum daily loss limit. Risk & Position Sizing: Indicate
Request for an Existing Automated Trading System (Expert Advisor) I am looking to acquire an existing, fully functional Expert Advisor (EA) that trades Forex CFDs, with the option of trading other CFDs if the strategy supports them safely. Performance objectives Target average net monthly return: 1.5%. A consistent 1.0% monthly return may be considered if the system demonstrates strong risk control and credible
Hi All, I am looking for a bot EA which makes good profit. If any having please share it for TEST. After proper TESTING only I will make the payment, no cheating no fraud. Please do not waste the time also
Allow me to set the daily trading bias manually to BUY or SELL. Check my defined 4H and 1H trend-alignment conditions. Execute entries based on my 15-minute pullback and continuation rules. Trade only between 06:00 and 16:00 Nigeria time, Monday to Friday. Calculate lot size based on my chosen risk percentage and stop-loss distance. Automatically place stop-loss and take-profit orders. Enforce my daily trade limits
Hi, I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I’m not looking to build one from scratch at this stage. I would like to first test the EA on a **demo account** to see how it performs under live market conditions and
Hi, I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I’m not looking to build one from scratch at this stage. I would like to first test the EA on a **demo account** to see how it performs under live market conditions and
Are you able to build one bot for stock and one for ninja trader and tell me the win rate on it. I need ninja trader bot that enter buy and exit according the move to do not stay long in the market in each entry . That can follow the smart money concept or other if you have a good one

프로젝트 정보

예산
50+ USD