XAUUSD Grid Recovery EA — HTF Trend Filter, Server-Side Pending Orders, Low-Latency Execution (MQL5)

Specification

PROJECT OVERVIEW

I need an experienced MQL5 developer to build a production-grade Expert Advisor for
XAUUSD (Gold) on MT5, intended for continuous, unattended live operation. This is a
trend-confirmed grid recovery system. Execution speed and reliability are the top
priorities — every recovery level must be a real pending order resting on the broker's
server, not something the EA monitors and reacts to on ticks. No blocking calls of any
kind are allowed in the tick-processing path.

CORE IDENTIFICATION

- Magic Number: 25051996
- Trade comment: TRCN-FX GOLD MINER 2.0

1. HTF TREND FILTER (H1, EMA5/EMA15 crossover)

- Direction is confirmed on the H1 timeframe using a 5-period EMA vs a 15-period EMA,
  read from the last FULLY CLOSED H1 candle (must not repaint intrabar).
- Fast EMA above Slow EMA = confirmed BUY trend. Fast EMA below Slow EMA = confirmed
  SELL trend.
- The EA may only open a NEW basket in the currently confirmed direction.
- If a basket is already open and the trend later flips against it, do not close it —
  keep managing it normally until it closes on its own (TP or max loss). No new trades
  are opened until it's fully closed, at which point the EA switches to the newly
  confirmed direction.
- Two opposite-direction baskets must never run at the same time.

2. LIVE MA-DISTANCE FILTER (new-trade qualification only)

- Before opening any NEW basket, check the live distance between the fast and slow H1
  EMA, measured on the current, still-forming candle (recalculated every tick — this is
  different from the direction check above, which only updates once per closed H1
  candle).
- A new basket may only open if this distance is at least a customizable minimum
  (default 200 points). Purpose: avoid opening new trades when the trend looks
  exhausted or is about to reverse.
- This filter does not affect an already-open basket.

3. INITIAL ENTRY — TRAP ORDERS

- Once flat and a direction is confirmed, place two real pending orders on the server,
  both in the confirmed direction:
  - A Stop order (breakout entry), default 25 points from current price.
  - A Limit order (pullback entry), default 25 points from current price.
  - Both distances must be independently customizable.
- Whichever triggers first becomes Order #1 and opens the basket. The other (untriggered)
  order must be deleted immediately.
- If the trend flips before either triggers, cancel both and re-place in the new
  direction.

4. RECOVERY GRID — REAL SERVER-SIDE PENDING ORDERS

This is the most important architectural requirements. 

- When Order #1 fills, immediately calculate the full remaining sequence of orders
  (up to a customizable Max Orders, default 20): price, lot size, and direction for
  each. Calculate this once.
- Immediately place ALL remaining levels as real pending Limit orders directly on the
  broker's server (Buy Limit below price for a BUY basket, Sell Limit above price for
  a SELL basket), so the broker's own matching engine triggers each fill instantly.
- Grid spacing: Orders 1–5 = 100 points apart, Orders 6–25 = 200 points apart (both
  customizable). - start lot = 0.02
- Lot sizing: each order's lot = previous lot x multiplier (default 1.65, customizable),
  respecting the broker's minimum/maximum/step lot rules.
- Track each level by its order ticket, and detect fills precisely by ticket (not by
  guessing which position belongs to which level).
- Every tick, verify each unfilled level's order still exists on the server; if it was
  deleted, expired, rejected, or stopped out without filling, re-place it automatically.

5. TREND REVERSAL MITIGATION

- If the H1 trend filter (see #1) flips against an already-open basket, apply this
  exactly once per basket:
  - All already-filled levels are left untouched.
  - All remaining unfilled levels keep their original prices, but their lot sizes are
    recalculated using a separate, smaller multiplier (default 1.30, customizable)
    compounding from the last filled level's lot.
  - Any live pending order affected by this must be deleted and re-placed at the new
    lot size (MT5 does not allow changing a pending order's volume in place).

6. SHARED BASKET TAKE-PROFIT

- One shared TP for the whole basket, default 50 points (customizable), calculated
  from the volume-weighted average entry price of all open basket positions.
- Recalculate and reapply after every new fill.
- On TP hit: close every position in the basket, verify full closure, and reset for a
  new cycle.

7. MAX BASKET LOSS

- A configurable maximum floating loss in account currency (default 15,000). When
  reached: stop placing any further recovery orders, close the entire basket, verify
  closure, reset.

8. TRADING SESSION FILTER

- Configurable daily trading window in Nigeria time (WAT, UTC+1), default 23:05 to
  21:00 (overnight, wraps past midnight).
- Outside this window: no new trap or recovery orders may be placed. Existing open
  positions and live pending orders continue to be managed normally.

9. MANUAL NEWS FILTER

- Up to 4 configurable news times (WAT), each with a configurable minutes-before and
  minutes-after buffer (default 15/15).
- During a news window: no new orders placed; existing positions/orders still managed.

10. EXECUTION REQUIREMENTS (highest priority)

- All trade actions must be asynchronous / non-blocking — no Sleep() or any other
  blocking wait anywhere in the tick-processing path.
- Retry any failed action on a short, non-blocking, time-gated basis so failures self-heal without spamming the
  server.
- Include a spread filter (on/off, configurable max spread) and slippage control that
  gate new order placement without affecting management of existing positions/orders.

11. STATE RECONCILIATION (every tick)

The EA must compare its internal state against the live MT5 account every tick and
self-correct:
- Detect and warn on any untracked/unexpected position.
- Detect and clean up stray or duplicate pending orders, without ever touching
  legitimate tracked recovery orders.
- Keep the basket TP correct on all open positions at all times.
- Detect a grid level whose order disappeared without filling, and re-place it.
- If a basket is flagged active but has no positions left, reset cleanly.

12. RESTART RECOVERY

After an EA, terminal, or VPS restart:
- Reconstruct the entire basket state from the live account: direction, filled levels,
  lot sizes, average entry, current TP, and which grid levels are still live as pending
  orders vs. already filled vs. missing.
- Resume without duplicating any order or skipping any level.
- Persist and restore the "highest floating account drawdown" figure across restarts.

13. DASHBOARD

A minimal, professional dark-panel dashboard on the chart showing: Status
(Waiting/Buy/Sell/Paused), Orders filled (X/20), total lots, average entry, basket TP,
floating P/L, basket drawdown, account balance, equity, account growth/loss (as a
currency amount), highest floating account drawdown (as a currency amount), current
HTF trend, live MA distance, reversal-mitigation status, the next unfilled grid level,
session status, and news status.

DELIVERABLES & EXPECTATIONS

- Fully commented MQL5 source code (.mq5), compiling with zero errors and zero
  warnings.
- A short test report or screen recording showing: a basket opening, at least 2–3
  recovery levels filling, the shared TP closing the basket, and a restart-recovery
  test (restart the terminal mid-basket and confirm the EA reconstructs state
  correctly).
- Please ask questions before quoting if anything above is unclear — I'd rather clarify
  upfront than renegotiate scope later.

Responded

1
Developer 1
Rating
(615)
Projects
718
33%
Arbitration
46
48% / 41%
Overdue
14
2%
Loaded
2
Developer 2
Rating
(395)
Projects
556
41%
Arbitration
30
57% / 3%
Overdue
57
10%
Free
Published: 11 codes
3
Developer 3
Rating
(2344)
Projects
2949
63%
Arbitration
124
44% / 26%
Overdue
429
15%
Free
4
Developer 4
Rating
(62)
Projects
90
29%
Arbitration
24
13% / 58%
Overdue
7
8%
Working
5
Developer 5
Rating
(434)
Projects
640
53%
Arbitration
34
62% / 21%
Overdue
6
1%
Working
6
Developer 6
Rating
(17)
Projects
21
19%
Arbitration
5
40% / 40%
Overdue
0
Free
7
Developer 7
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
0
Free
8
Developer 8
Rating
(173)
Projects
185
46%
Arbitration
3
33% / 33%
Overdue
1
1%
Working
9
Developer 9
Rating
(83)
Projects
95
32%
Arbitration
9
22% / 56%
Overdue
5
5%
Working
10
Developer 10
Rating
(319)
Projects
567
35%
Arbitration
82
30% / 45%
Overdue
205
36%
Working
11
Developer 11
Rating
Projects
1
0%
Arbitration
0
Overdue
0
Free
12
Developer 12
Rating
(2674)
Projects
3413
68%
Arbitration
77
48% / 14%
Overdue
342
10%
Free
Published: 1 code
13
Developer 13
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
0
Free
Published: 1 code
14
Developer 14
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
15
Developer 15
Rating
(3)
Projects
9
67%
Arbitration
0
Overdue
0
Working
16
Developer 16
Rating
(28)
Projects
34
35%
Arbitration
0
Overdue
2
6%
Free
17
Developer 17
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
1
100%
Free
18
Developer 18
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Working
19
Developer 19
Rating
(18)
Projects
22
18%
Arbitration
8
38% / 38%
Overdue
3
14%
Working
Published: 1 code
20
Developer 20
Rating
(6)
Projects
8
38%
Arbitration
1
100% / 0%
Overdue
2
25%
Free
21
Developer 21
Rating
(14)
Projects
20
25%
Arbitration
0
Overdue
2
10%
Working
Published: 3 codes
22
Developer 22
Rating
(8)
Projects
8
0%
Arbitration
2
50% / 0%
Overdue
1
13%
Working
23
Developer 23
Rating
(25)
Projects
31
13%
Arbitration
13
0% / 77%
Overdue
9
29%
Working
24
Developer 24
Rating
(551)
Projects
839
61%
Arbitration
33
27% / 45%
Overdue
24
3%
Free
Published: 1 code
25
Developer 25
Rating
(209)
Projects
271
21%
Arbitration
24
50% / 17%
Overdue
0
Working
26
Developer 26
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
27
Developer 27
Rating
(366)
Projects
449
55%
Arbitration
23
57% / 17%
Overdue
30
7%
Working
28
Developer 28
Rating
(3)
Projects
4
0%
Arbitration
1
100% / 0%
Overdue
1
25%
Free
29
Developer 29
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
30
Developer 30
Rating
(1)
Projects
1
0%
Arbitration
0
Overdue
0
Free
Similar orders
EA VAULT V5.1 30 - 200 USD
//+------------------------------------------------------------------+ //| EA_VAULT_V5_1_Otsile_Classic.mq5 | //| v5.11: CLASSIC VAULT EDITION - Smart Risk + License| //| Author: Otsile Trading | //| Icon: Bank Vault Guardian | //+------------------------------------------------------------------+ #property strict #property version "5.11" #property description "EA VAULT V5.1 CLASSIC EDITION" #property icon
1. PROJECT OVERVIEW Development of a custom automated and manual trading bot for NinjaTrader 8, primarily designed for Nasdaq Futures (NQ/MNQ). The bot will contain the original trading strategy, configurable risk management, automatic and manual operating modes, alerts, profit/loss management, partial profit taking, Break Even, backtesting functionality, and the additional configurable contract-averaging system
Look at this chart. The ellipses that I have identified show reversals and liquidity was I am trying to find a good way to identify these areas an indicator that automatically detects the sweep and reversal Look at this chart. The ellipses that I have identified show reversals and liquidity was
RECHERCHE DÉVELOPPEUR MQL5 — PARTENARIAT 50/50 Objectif : développer un EA de trading automatisé en 11 jours maximum pour participer à plusieurs concours de trading démo. Je recherche un développeur MQL5 expérimenté, capable de développer, tester et optimiser un EA proprement, avec une vraie maîtrise de la gestion du risque. CONCOURS VISÉS 🥇 XM — Weekly Demo Contest - Concours récurrent - Prize pool annoncé : 25 000
can you help me with I have an indicator that I built and I work with PickMyTrade. The entries come through the alerts I get from Trading View . Trading View needs to send an alert and PickMyTrade executes a trade at that exact same second. Now, I have a problem in Trading View with the synchronization between the alert and the signal. I have a box that I built for a trade. It needs to output the box and get an
I need an MT4 Expert Advisor (MQL4). 1. Open one Buy and one Sell trade simultaneously. 2. Adjustable lot size (default 0.01). 3. Stop Loss on both trades. 4. If one trade hits Stop Loss: - Do not open a replacement trade. - Leave the remaining trade open. 5. Optional trailing stop: - On/Off switch. - Adjustable distance. 6. When the remaining trade closes: - Open a new Buy and Sell pair. - Repeat continuously
Hi, I Wanne have a trading robot that give me signals for short buy and sell. And only for all currency in forex trading and also can use it on mt5
Project Title: Modular Session Breakout & Multi-MA EA with Anti-Whipsaw Filters Requirements: Please build an EA where every feature can be individually turned ON/OFF via an independent toggle switch and configured via adjustable parameters. The EA should function as an efficient "Entry Engine" that works in tandem with external risk managers (e.g., KT Equity Protector). 1. Global Settings Master Switch: Global
I need an MT5 Expert Advisor for a mean-reversion strategy on EURUSD: single entry at local price extremes, fixed stop loss and take profit, no grid and no averaging. Position size must be calculated automatically so that risk per trade is capped at a fixed USD amount, with a daily loss limit and a pause after consecutive losses. I will send the full specification — entry conditions, filters and all input parameters
I am looking for a professional and market-savvy MQL developer to build a disciplined, stable Scalping Expert Advisor (EA). The ideal developer must have a solid understanding of Trend Identification, Fibonacci Levels, and Technical Indicators , alongside strict risk management implementation. Key Focus Areas & Developer Requirements: Market & Analysis Expertise: ⚬ Deep understanding of Trend direction (Market

Project information

Budget
50 - 100 USD
Deadline
to 20 day(s)

Customer

Placed orders1
Arbitrage count0