MT5 Grid EA with Auto Re-Anchor, Anti-Failure Logic, and Global Take Profit System

작업 종료됨

실행 시간 12 일
고객의 피드백
approved! thank you Rodrigue
피고용인의 피드백
Happy to work with you

명시

💼 Job Description (full text for MQL5 Jobs)

Project Overview

I need a MetaTrader 5 Expert Advisor (MQL5, Hedge account) that executes a grid-based anti-failure strategy.
The EA should anchor at the latest top (highest high), place BUY LIMIT orders at predefined retracement levels, and close all positions simultaneously when the average price reaches a global Take Profit target (in %).

After the global closure (TP, SL, or manual), the EA must cancel all remaining pending orders, re-anchor automatically to the latest high, and rebuild the entire grid.

⚠️ I already have a partial version of this system.
The main issue to fix is: when one trade closes at TP, other pending orders remain stuck on the chart.
I need it to close everything, reset, and start over cleanly after each cycle.


Strategy Logic

1. Anchor Logic (Top Reference)

  • Anchor at the highest high of a user-defined timeframe (e.g. D1) within a defined lookback period (e.g. 10,000 bars).

  • Re-anchor only if:

    1. There are no open BUY positions, and

    2. A new high ≥ (previous_anchor * (1 + ReanchorThrPct / 100)) occurs.

  • While any BUY position remains open, the anchor must not change.

  • After all positions close, the EA checks for a new high and rebuilds the grid.


2. Grid Placement (BUY LIMIT Orders)

  • Up to 10 levels, each with:

    • LevelPctN → retracement % from anchor top

    • LotN → fixed lot size for that level

  • BUY LIMIT price = AnchorHigh * (1 - LevelPctN/100)

  • Prevent duplicates:
    If a pending order already exists within PriceTolPts (price tolerance in points), do not resend it.

  • Orders use DeviationPts (slippage/deviation setting).


3. Global Take Profit by Average Price

  • When one or more BUY positions are open (same Magic Number), calculate volume-weighted average entry price.

  • Set global Take Profit = AvgPrice * (1 + TP_Percent / 100)

  • All open BUY trades must share this same TP.

  • If the difference between current TP and target TP > ModifyTolPts , the EA updates all positions’ TP accordingly.


4. Reset & Re-Arm Sequence
After all BUY positions are closed:

  1. Cancel all pending BUY LIMITs for that Magic Number.

  2. Recalculate AnchorHigh (check for new top using the rules above).

  3. Rebuild the grid with the same parameters from the new anchor.

This reset must also trigger if trades close via TP, SL, or manual closure.
Use OnTradeTransaction with DEAL_ENTRY_OUT to detect when all positions are closed.


Magic (ulong)
AnchorTF (ENUM_TIMEFRAMES)
BarsLookback (int)
ReanchorThrPct (double)
LevelsCount (int)
LevelPct1..10 (double)
Lot1..10 (double)
TP_Percent (double)
PriceTolPts (int)
ModifyTolPts (int)
DeviationPts (int)

Technical Requirements

  • Must be coded in pure MQL5 (no MT4 or conversion).

  • Must use CTrade (Trade/Trade.mqh) and OnTradeTransaction.

  • Fully compatible with Hedge accounts.

  • Must compile with 0 errors and 0 warnings on the latest MT5 build.

  • Handle different symbol digits/points (e.g., XAUUSD, BTCUSD).

  • Must run and optimize properly in "Every tick based on real ticks" mode.

  • Include clear internal logs for:

    • Anchor/re-anchor detection

    • Grid creation/deletion

    • TP updates

    • Reset/Re-arm events


Acceptance Criteria

  1. Compiles cleanly (0 errors/warnings) on MetaEditor 5.

  2. In a visual backtest, the EA must:

    • Place BUY LIMIT grid at the anchor top.

    • When one or more trades hit TP → close all open positions + cancel all pending orders.

    • Re-anchor to the next valid top and rebuild the grid automatically.

    • Not re-anchor while trades are still open.

    • Avoid duplicate pending orders within PriceTolPts .

    • Update global TP properly when average entry changes.

  3. Works consistently on XAUUSD, BTCUSD, and other CFD pairs.


Deliverables

  • One .mq5 file (full source code, well-commented).

  • Short “readme” with:

    • How to attach EA to chart

    • Recommended test settings

    • Suggested parameters for XAUUSD and BTCUSD (H1, 10/20/30/40/55 retracements, lots 0.01–0.03, TP=12%).

  • 30-day bug fix period after delivery (minor corrections included).


Optional (Nice to Have)

  • Option for partial close (close X% of positions at an intermediate TP).

  • CSV export of anchor, TP, and deal data.

  • Backtest cost simulation (spread/commission/slippage).


What to Include in Proposal

  • Links or screenshots of previous MT5 EAs using OnTradeTransaction .

  • Confirmation that all acceptance criteria will be met.

  • Delivery time and final price.


🟢 Notes from client (Wily Machado):
I already have partial working logic, but compilation and event handling keep failing.
The goal is a stable, clean, and testable EA that can run long-term safely with low drawdown and consistent profits.
If you deliver that, I’ll likely hire you again for optimization and advanced modules (partial exits, trailing TP, etc.). 



응답함

1
개발자 1
등급
(17)
프로젝트
21
10%
중재
4
50% / 50%
기한 초과
1
5%
작업중
2
개발자 2
등급
(4)
프로젝트
4
25%
중재
1
0% / 0%
기한 초과
0
작업중
3
개발자 3
등급
(159)
프로젝트
284
35%
중재
17
24% / 59%
기한 초과
42
15%
로드됨
4
개발자 4
등급
(14)
프로젝트
19
11%
중재
1
0% / 100%
기한 초과
5
26%
무료
5
개발자 5
등급
(1)
프로젝트
3
0%
중재
0
기한 초과
0
무료
6
개발자 6
등급
(305)
프로젝트
546
35%
중재
79
32% / 42%
기한 초과
196
36%
작업중
7
개발자 7
등급
프로젝트
0
0%
중재
1
0% / 100%
기한 초과
0
무료
8
개발자 8
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
9
개발자 9
등급
(1)
프로젝트
2
0%
중재
1
0% / 100%
기한 초과
0
무료
게재됨: 2 코드
10
개발자 10
등급
(327)
프로젝트
392
52%
중재
20
55% / 15%
기한 초과
28
7%
로드됨
11
개발자 11
등급
(16)
프로젝트
20
0%
중재
10
0% / 80%
기한 초과
6
30%
무료
12
개발자 12
등급
(247)
프로젝트
253
30%
중재
0
기한 초과
3
1%
무료
게재됨: 2 코드
13
개발자 13
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
An example of buying and another of selling Buy at the current price. If the price drops by a certain amount, denoted as 'x', buy from below. If it continues to drop, buy from after 'x2'. If it continues to drop, buy from 'x3'. Example: We bought at point zero. The price dropped by 100 points, so we buy. It dropped by 200 points to -300, so we buy. It dropped by 300 points to -600, so we buy. 0 - 100 - 300 - 600 -
Boeta 40+ USD
Trade make the market look easy check update show me the lost and profits show me my profit I made show canddle step by step explain show traders marking the profits show time difference between the countries
I am seeking an experienced freelance marketing and algorithmic trading specialist to develop a user-friendly automated trading bot for the Pocket Option platform. The system should feature a simple and secure interface that allows direct login using my existing credentials. The bot will be designed to operate exclusively on multiple OTC currency pairs (a minimum of 10, such as EUR/USD OTC, GBP/JPY OTC, and similar
The robot will take buy trades when the 2 ema cross over the 10 ema and price has closed above the 50 ema. The take profit and stop loss can be set as an optional level by the user. The robot will take sell trades when the 2 ema cross under the 10 ema and price has closed under the 50 ema. The take profit and stop loss can be set as an optional level by the user. The entry timeframe will be 15 minutes, but it could
GoldTrade EA 30 - 60 USD
Hi, I am looking for someone who has already developed a high-performance Gold EA that can outperform the one shown in my screenshot. If you have such an EA, please apply for this job. Please describe how the EA works (for example, whether it uses a grid system) and provide backtest results along with the set files. If the EA meets my expectations, you can make the necessary adjustments and I will use it as my own
Create simple EA 30 - 60 USD
Start BUY:- when i click start BUY button new panel should open which should contain bellow points:- Trigger Price Time frame Cross/Close RR ration Trailing Stop ratio Maximum Trade count Risk (percentage or cash) (Option to Increase risk when SL hit) Remove Trigger (True/False ) I will explain above point one by one here bellow •Trigger price :- here we enter price at which when market cross or
I want to check if this indicator is repainting or not Whick mean the results of back testing is legit or not if anyone can help me to review it kindly to well to contact me i will be happy to work and go on long term work with anyone thanks
PrimeFlowEA — v1 Specification Objective: PrimeFlowEA v1 is designed to enforce disciplined, rule-based execution within a single daily trading session. The goal of v1 is correct behavior and execution discipline , not optimization or performance tuning. 1. Market & Time Platform: MetaTrader 5 (MQL5) Symbol(s): User-selectable (single symbol per chart) Execution timeframe: Configurable (default: M5 / M15)
Specifications – Development of an MQL5 Expert Advisor (Reverse Engineering) Project context: I have access to a real trading history consisting of more than 500 trades executed over a period of approximately 3 years. These trades have been exported into a CSV file containing all available information, including date, time, symbol, order type, entry price, and exit price. Important: I do not have access to the
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi

프로젝트 정보

예산
50+ USD