Grid | Hedge | Martingale with TrailingStop

MQL5 Experten Forex

Spezifikation

Hi! Below is the explanation of the EA together with an example in image. I attached a TrailingStop and TrailingStep code as references that I have been using on another EA. The PDF file contains the same description, but with some expected inputs as example.


Explanation:

1) The EA strategy is summarized in opening up to 20 multiple positions according to each range of points reached in the opposite direction of the operation (Grid when activated by bool input), and closing with profits according to the values ​​of Trailing Stop / Trailing Step.


2) The lot of each position (1st to 20th) will be different and should be informed in the input (20 lots inputs)

 

3) The interval /range in points to open the next grid position must be informed in the input, and it will be different for each position (20 interval inputs)

 

4) The exit of a position with a profit will occur through the “TrailingStopProfit” with “TrailingStepProfit”, which will be activated with each new position of the grid as soon as the current price (long position example) is above the sum of the calculation:

a) "Average Price / Breakeven*" of the operation +

b) a value in pips informed in the input called "ProfitZone" +

c) the sum of the entry and exit commissions so far according to the lots (commission amount per 1 lot will be entered via input to be calculated by the EA).

 

5) Aiming to reduce the risk, I must inform from which position I want to exit with less profit (“StartSecureZoneAtPosition”). In the chosen position of this input and next positions of this grid the exit will be through value of “TrailingStopSecure” with “TrailingStepSecure”, which will be activated when the current price (long position example) is above the sum of the calculation:

a) "Average Price / Breakeven*" of the operation +

b) a value in pips informed in the input called "SecureZone" +

c) the sum of the entry and exit commissions so far according to the lots.

 

6) Date / Time Filter: It must be possible to specify the days of the week and time to make the entries, for example: Monday to Thursday from 2AM to 8PM (“EachDay” at those times – bool option) or Monday from 2AM to Thursday 8PM (“NonStopDay” bool option). To avoid having an open position on the weekend, if there is a trade in progress and the option (input bool) "ForceCloseAll" is "true", all paper trades must be closed at once at the specified time and day (Ex : ForceCloseAllDay = "Friday"; ForceCloseAllHour = 9)

 

7) Spread filter: maximum spread in pips (“MaxSpread”) acceptable to open the first position.

 

8) As for the entry of operations, that is, the 1st trade, it can be done in two ways:

 

a) By the Expert Advisor:

BUY: The closing of the previous candle is greater than the maximum of the last N candles (“Ncandles”).

SELL: The previous close is less than the minimum of the last N candles (“Ncandles”).

or

b) Manually:

With the EA active on the chart, I will add a pending order on the paper with the initial batch (One click trading or other method), and as soon as the order is executed the robot will follow up with the trailing for profit or grid for the next order ( 2nd) and others.

 

9) The robot can be used on assets/currencies with different decimal places (such as EURUSD “1.45120”, USDJPY “115.120” and assets without decimal places “265”).

 

10) If the operation reaches position 20, trades must be closed at the loss as soon as it reaches the next range specified in the input (Position 20 + “Range21Close”).

 

11) A “Complete Operation” means a trade that has been completed by Trailing (profit), or a trade that is closed with a loss after position 20. Only one “Complete Operation” must be allowed at a time. Example: The EA is on the Grid in the 5th position and a new buy / sell condition is reached by the indicator. This trade should not be executed, since there is already an “Operation” in progress.

 

12) The file provided must be open source (mq5) so that I can make changes in the future and add more positions in the grid if necessary.

 

13) When “true” (will open a maximum of 2 positions of the Grid): the position will maintain the profit rules (item #4), but will close after reach “Range3_or_StopLoss” points. That is, instead of opening the 3rd position, it will close all positions.

 

*Average Price/Breakeven: The average price of all current Grid operations where the balance of the operation is $ 0. For example:

1 Lot at $50

2 Lots at $100

5 Lots at R$150

Median Price is (1x$50 + 2x100 + 5x150) / (1+2+5) = $125 .

If possible, I would like to see the line of “Median Price” on chart. Please tell me if this won’t be possible.


Bewerbungen

1
Entwickler 1
Bewertung
(23)
Projekte
45
20%
Schlichtung
25
28% / 48%
Frist nicht eingehalten
12
27%
Frei
2
Entwickler 2
Bewertung
(4)
Projekte
6
33%
Schlichtung
3
0% / 100%
Frist nicht eingehalten
0
Frei
3
Entwickler 3
Bewertung
(8)
Projekte
10
40%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
Take an existing Grid Trading EA that I currently have for MT4 and either modify it or recreate it. Delete everything below where it says " Trend Filters " Add: The ability for the EA to increase the lot size by a specific amount ( .01 or .02 or .03, ect. ) each time it adds a new position long or short Add: A profit target for the EA to reach when it will close out of all positions and start trading again or other
I have an existing MT5 Expert Advisor for XAUUSD M5. This is NOT a new robot from zero. I need modification and professional review of an existing MQL5 EA. Main goals: 1. Buy entries: Buy trades are currently too rare. The Buy ADX filter was very strict at 45. I am testing 40 now. I need you to review the Buy entry filters and improve Buy entry quality without making entries random or weak. 2. Sell entries: Sell
I am looking for an experienced MQL5 developer to build a professional MetaTrader 5 (MT5) Expert Advisor (EA) for swing trading. Trading Pairs EUR/USD USD/JPY Timeframes Daily (D1) for trend identification. H4 for trade entries. Strategy The EA should: Detect Daily market structure (HH, HL, LH, LL) using confirmed swing highs and lows (not relying solely on ZigZag). Use DMI/ADX for trend confirmation. Open trades
English Description (For Developers): I need a custom Expert Advisor (EA) for MT5 to trade ONLY ETHUSD based on trend-following and counter-trendline breakout-retest with an M1 execution filter and strict risk management. Trading Logic: 1. Trend Filter: Price must be below 200 EMA on both H1 and M15 timeframes for Short (Sell) trades. (Opposite for Long/Buy trades). 2. Setup: On the M15 chart, after a strong move in
Hello, I want an EA which does martingale and has hedge feature. You may be confused by what this mean entirely so reach out to me so we can talk in depth as what I have said here is very vague for someone to clearly understand. I am not paying a single dollar over $30, so don't apply if you don't agree with that. Thank you for taking your time to read this
أحتاج إلى مستشار خبير لمنصة MetaTrader 5 (MT5) مصمم كآلة حالة محدودة (FSM). يجب أن ينفذ أوامر السوق فقط بناءً على مستويات أسعار يحددها المستخدم. يجب ألا يستخدم أي مؤشرات أو تحليل فني أو أوامر معلقة أو ذكاء اصطناعي أو قرارات تداول تلقائية. يجب أن ينفذ المستشار الخبير ببساطة تسلسلًا محددًا مسبقًا لمستويات الأسعار كما يحددها المستخدم تمامًا، مع إدارة دقيقة للحالة، ودورة نشطة واحدة في كل مرة، ومعالجة الفجوات السعرية،
Message me please for the investor login. You will replicate the ea and I shall tell u some things about it, I am not paying over $100. You should have great skills. The EA can handle any market and shall not blow the account
Мне нужен простой торговый бот, написанный исключительно на Python. Бот должен подключаться к терминалу MetaTrader 5 через официальную библиотеку Python "MetaTrader5". Объем кода невелик (около 250 строк). КРИТИЧЕСКИ ВАЖНЫЕ ТРЕБОВАНИЯ: 1. НЕТ КОДА MQL5: Весь проект должен быть написан только на Python. 2. ВНЕШНЯЯ КОНФИГУРАЦИЯ: У бота должен быть внешний конфигурационный файл (config.ini или settings.json). Я должен
[7/6/2026 12:24 PM] DR.HassaN: Current Phase: Comprehensive Review & Final Enhancement_ This indicator is designed for the TradingView platform. Now that the core engines have been completed, I want to enter a comprehensive review and professional enhancement phase before adding any major new features. My goal is to transform this indicator into a premium institutional-grade TradingView indicator , both in terms of
Part 1: Project setup Input settings (risk, stop loss, take profit, EMA periods) Indicator initialization Trade management framework Part 2: Trading logic EMA crossover detection Buy/Sell entry rules One-trade-per-symbol check Part 3: Risk management Automatic lot size calculation Stop-loss and take-profit placement Trade execution and error handling Part 4: Final touches On-screen information Optimization

Projektdetails

Budget
30 - 45 USD
Ausführungsfristen
von 1 bis 15 Tag(e)