Build an MT5 Expert Advisor: Grid Martingale with Dual Cycles & Hedge

仕事が完了した

実行時間9 日
依頼者からのフィードバック
This developer was a dream! He coded my EA perfectly, was incredibly responsive, and patiently answered all my questions. Felt completely supported throughout the entire process.
開発者からのフィードバック
Amazing Customer

指定

EA Concept: Grid Martingale with Hedge

This EA for MT5 (MQL5) runs a continuous price-level grid system with independent buy and sell cycles.
It uses manual martingale lot sizes, a hidden profit target, and a Full hedge when price moves too far from the anchor or reaches max negative equity.

No indicators or signals — it starts trading immediately on launch.


🎯 Core Behavior

  • Rule # 1: Always has one buy and one sell base trade active on each grid.

  • Rule # 2:  As price moves in one direction, the with-trend side keeps taking hidden TPs at next grid and reopening.

  • Rule # 3:  The against-trend side builds a martingale basket using predefined lot steps.
  • Rule # 4:  Once the basket’s total floating profit reaches a set cash or pip target, it closes all trades on that side together.
  • Rule # 5:  If price keeps trending far enough (past a defined number of grids or equity), the EA opens a full hedge to flatten exposure, then resets the whole cycle.

⚙️ Key Inputs

Input Description
GridSizePips = 30 Distance between grid levels
LotSizes = "0.01;0.02;0.03;0.06;0.09;0.18;0.33;0.57;0.75" Manual list of lot sizes per leg; last one repeats if needed
Profit$ = 10 Hidden profit target in account currency (for martingale baskets)
ProfitPips = 5 Hidden pip target from weighted average price
HedgeLevel = 10
Number of grids from anchor before hedge trigger
Max Equity = 1000  Maximum Negative Equity from anchor will trigger hedge 
MaxSpreadPips = 1 Spread filter – skip new trades if exceeded
MagicNumber = 1995 Default magic number, user can change
SlippagePips = 1 Max slippage allowed
AllowHedgeReset = true Enables/disables the hedge reset logic
AllowNewCycle = true Master on/off switch for opening new cycles after hedge
CommentTag = "GridMartingaleEA" Order comment prefix

🧩 Definitions

  • Pip: 0.0001 for standard pairs, 0.01 for JPY pairs.

  • Convert grids to points automatically.

  • Spread check: If spread > MaxSpreadPips, skip new entries but continue managing open trades.


🔁 State Model (per symbol)

The EA tracks:

  • anchor_price : Starting point for the current grid cycle.

  • grid_index : Current grid level relative to anchor.

  • Lists of open buy and sell trades (tickets, lots, prices, grid levels).

  • lot_step_index_buy/sell : Which lot size to use next.

  • hedge_triggered : Flag for when hedge is active.

  • cycle_id : Used in comments for order tracking and recovery after restart.


🧠 Trading Logic Summary

  1. On startup (Grid 0)

    • Open one Buy and one Sell (first lot each).

    • No visible SL/TP — handled internally.

  2. When price moves one grid up:

    • The Buy side (with trend) closes its hidden TP and reopens a new base Buy at the new level.

    • The Sell side adds a new leg (next lot size) at the new grid level.

  3. When price moves one grid down:

    • Mirror behavior — Sell side takes profit and reopens; Buy side adds new leg.

  4. Take Profit rules:

    • Base trades close individually on hidden TP (small cash or pip target).

    • Martingale baskets close all legs together when combined profit hits the target (cash or pips).

  5. Hedge Reset:

    • If price moves HedgeLevel grids away from anchor, EA opens a hedge position equal to total opposite exposure.

    • After that, all orders stay open for manual closure.

    • EA resets cycle (new anchor = current price, clear arrays, start over).

  6. Limits:

    • Max one buy and one sell per grid level.

    • If spread too high, skip entries.

    • Continue managing existing trades even when new entries are paused.


🧾 Technical Notes for Implementation

  • Use SymbolInfoInteger to get pip size/digits.

  • Parse LotSizes string into a numeric array; repeat last value if more legs are needed.

  • Respect broker min/max lot and margin.

  • Handle ECN brokers (no SL/TP on order send).

  • Retry on REQUOTE or PRICE_CHANGED .

  • Identify each order by magic number + cycle_id + grid + side + leg in comment.

  • Manage logic on every tick (or timer for quiet markets).


🧱 Example Flow

  1. Grid 0: Buy 0.01, Sell 0.01

  2. Price up 1 grid → Buy hits hidden TP → new Buy 0.01; Sell adds 0.02 leg

  3. Price up another grid → Buy TP again → new Buy 0.01; Sell adds 0.03 leg

  4. Price drops back → Buy side now accumulates legs; Sell side resumes its base TP behavior.

  5. If Sell basket profit ≥ $10 (or 5 net pips), close all Sell legs; reset side.


🧩 Summary in One Line

Always one buy + one sell active, build martingale legs only on the losing side, close baskets at hidden TP, and if price drifts too far — hedge Full and restart EA.


On-Chart Summary Display

Add an on-chart status summary that updates automatically while the EA is running.
The summary should display key live metrics for both Buy and Sell sides in a compact, readable format at the top-left corner of the chart.

Display format example:

Grid Martingale EA Status Summary Buy Side: Neutral Sell Side: Martingale Martingale Trades Open: 5 Total Martingale Lots: 1.70 Floating P/L: -215 USD Anchor Price: 1.08420 Current Grid Index: +3 Hedge Trigger: OFF Cycle ID: 24 Spread: 0.8 pips

Behavior requirements:

  • Refresh automatically on every tick (or once per second).

  • Always show the current EA state clearly — even if no trades are open.

  • If either side (Buy or Sell) is running a martingale sequence, label it as “Martingale”; otherwise, “Neutral”.

  • Floating profit/loss should show the combined unrealized P/L of the active martingale basket in account currency.

  • Use consistent decimal precision (2 for lots, 1 for pips, 2 for USD).

  • Optional: color-code values for clarity (e.g., green for profit, red for loss).

Placement and style:

  • Top-Right or Left corner of the chart.

  • Clear, easy-to-read font.

  • Simple layout, no external UI libraries needed.

  • Should not interfere with order execution or EA logic.


応答済み

1
開発者 1
評価
(19)
プロジェクト
23
9%
仲裁
6
33% / 50%
期限切れ
1
4%
取り込み中
2
開発者 2
評価
(509)
プロジェクト
977
74%
仲裁
27
19% / 67%
期限切れ
101
10%
パブリッシュした人: 1 article, 6 codes
3
開発者 3
評価
(257)
プロジェクト
263
30%
仲裁
0
期限切れ
3
1%
パブリッシュした人: 2 codes
4
開発者 4
評価
(85)
プロジェクト
169
44%
仲裁
3
67% / 0%
期限切れ
5
3%
仕事中
パブリッシュした人: 1 code
5
開発者 5
評価
(6)
プロジェクト
5
0%
仲裁
2
50% / 50%
期限切れ
2
40%
6
開発者 6
評価
(312)
プロジェクト
559
35%
仲裁
79
32% / 43%
期限切れ
203
36%
仕事中
7
開発者 7
評価
(14)
プロジェクト
19
11%
仲裁
1
0% / 100%
期限切れ
5
26%
8
開発者 8
評価
(24)
プロジェクト
30
13%
仲裁
12
0% / 75%
期限切れ
8
27%
9
開発者 9
評価
(156)
プロジェクト
197
59%
仲裁
10
80% / 0%
期限切れ
0
パブリッシュした人: 1 code
10
開発者 10
評価
(6)
プロジェクト
6
17%
仲裁
1
0% / 0%
期限切れ
0
仕事中
11
開発者 11
評価
(1)
プロジェクト
1
0%
仲裁
0
期限切れ
0
12
開発者 12
評価
(1)
プロジェクト
2
0%
仲裁
1
0% / 100%
期限切れ
0
パブリッシュした人: 2 codes
13
開発者 13
評価
(77)
プロジェクト
243
74%
仲裁
7
100% / 0%
期限切れ
1
0%
パブリッシュした人: 1 article
類似した注文
5.20buy-20.5sell 50 - 1000 USD
⸻ 🧠 Professional AI Prompt (Clear English Version) Act as a professional algorithmic trading engineer with deep expertise in developing automated trading systems for TradingView and MetaTrader. You have strong knowledge of market behavior, trend analysis, and risk management. Your task is to design a fully automated trading strategy based on the following requirements: ⸻ 🎯 Entry Conditions: • Open a BUY trade
I am looking for an experienced MQL5 developer to create a custom technical indicator for MetaTrader 5. The indicator should combine Supertrend logic with Support/Resistance pullback levels to generate high-probability entry signals. 1. Core Logic The indicator must follow a two-step confirmation process: Trend Identification: Use the Supertrend indicator to determine the primary trend. Entry Signal (The
VWAP BB Sniper EA Quantum VWAP Scalper SmartFlow FX Bot Institutional Edge EA 🧠 PRODUCT OVERVIEW VWAP + Bollinger Bands Auto Trading System A high-precision forex scalping bot designed to capture institutional price movements using: VWAP (fair value tracking) Bollinger Bands (volatility & entry timing) 👉 Built for fast, consistent intraday profits
I am a Professional Forex Trader, actively working in the financial markets with a strong focus on how price truly moves. I specialize in logic, market structure, and institutional behavior rather than indicators or guesswork. I have mastered: • Market Structure • Trend Identification • Elliott Wave Theory • Wyckoff Logic My core expertise lies in: • Deep understanding of market structure • Identifying
Hello traders, I have Quantum queen v3.52, which is the latest version, available for $500 only. The price on the platform is around $1800, but I am offering it for a much lower price for serious buyers. Details: Product: Quantum queen Version: v3.52 Price: $500 Condition: Serious buyers only
EA for prop firms 30 - 500 USD
Hi, I am looking to purchase a MT5 EA that can show consistent profitability 5% each month with drawdown less than 9%. I am not ready to build a new one from scratch as i do not have the strategy in mind yet so i do not want to take the risk of building one but not sure if it works. Only apply if you have an existing proven and tested EA that can sell to me together with the source code. The Ea is for prop firm even
I am a professional trader specializing in technical analysis using a powerful combination of Fibonacci strategies and Dow Theory. With strong experience in reading market structure, I am able to identify major trends, precise entry points, and key support & resistance levels with high accuracy. My approach goes beyond using a single indicator. I combine Fibonacci retracement & extension to pinpoint potential
Early Killer EA 30+ USD
It must have automated stop loss. Something that can end poverty and kill the market early.It must take the trades for me whenever I start it it must work on tradeport ea
I WANT TO CONVERT MY INDICATOR TO ROBOT, BUT I DONT HAVE THE SOURCE CODE , THE PROGRAMMER WILL DEVELOP THE SOURCE CODE FOR THE JOB. THE STRAGY IS SIMPLE , THE ROBOT WILL EXECUTE A TRADE WHEN THE SIGNAL FROM THE INDICATOR APPEARS. BUY SIGNAL IS WHEN THE ARROW APPEAS ON THE LOWER ZONE ( SUPPORT ZONE) SELL SIGNAL WHEN THE ARROW APPEARS ON THE UPPER ZONE ( RESISTANCE ZONE).THE ROBOT WILL HAVE THE FOLLWING FEATURES (1)
CONVERT MQL4 ROBOT TO MQL5 Solana I have robot SOLANA i want to change my robot for MQL4 ROBOT TO MQL5 AND also change the name of the robot..i need it with the source code

プロジェクト情報

予算
30+ USD
締め切り
最高 2 日