Add smart trailing

MQL5 Experts Forex

Job finished

Execution time 31 days

Specification

Hello,

I have the EA source code ready, and it is open-source/editable. I need you to add and improve the trailing stop logic with two clear inputs:

1. Trailing Start
2. Trailing Step

Please implement it carefully and accurately.

Trailing Start  
This is the profit distance where the EA starts activating the trailing stop.

Example:
If Trailing Start = 35 pips, the EA should not move the Stop Loss until the trade reaches +35 pips profit.

Trailing Step  
This is the step distance used to move the Stop Loss after trailing starts.

Example:
If:
Trailing Start = 35 pips  
Trailing Step = 12 pips  

Then the logic should be:

- At +35 pips profit → move SL to around +5 pips profit
- At +47 pips profit → move SL to around +17 pips profit
- At +59 pips profit → move SL to around +29 pips profit
- At +71 pips profit → move SL to around +41 pips profit
- At +83 pips profit → move SL to around +53 pips profit

The Stop Loss should always trail behind the current profit by the selected step distance.

Very important requirements:

- The EA must only move the Stop Loss forward in profit.
- The EA must never move the Stop Loss backward.
- The trailing must work correctly for both Buy and Sell trades.
- The EA must calculate pips/points correctly on XAUUSD and XAUUSDm, especially on Exness.
- The trailing must continue working correctly after partial close.
- If partial close is enabled, the EA should close 50% first, then manage the remaining position with break-even and trailing stop.
- Avoid repeated unnecessary SL modifications on every tick to prevent errors, freezing, or broker rejection.
- Please make sure the logic respects broker stop levels and minimum distance rules.
- If a manual Stop Loss already exists, the EA should respect it and only improve it when the trailing condition is reached.
- Please keep the existing EA features and only add/improve this trailing logic without breaking the current workflow.

Suggested default settings for XAUUSD:

Partial Close Trigger = 30 pips  
BreakEven Trigger = 30 pips  
BreakEven Offset = 5 pips  
Trailing Start = 35 pips  
Trailing Step = 12 pips  

Also, if you think there is a better professional improvement for gold trading, such as ATR-based trailing, spread filter, or news/time filter, please suggest it before implementation.

Please test the EA carefully on XAUUSD/XAUUSDm to make sure the trailing stop works exactly as described and without execution errors.

Responded

1
Developer 1
Rating
(2)
Projects
2
0%
Arbitration
0
Overdue
0
Free
2
Developer 2
Rating
(282)
Projects
353
29%
Arbitration
37
27% / 65%
Overdue
10
3%
Loaded
3
Developer 3
Rating
(213)
Projects
286
47%
Arbitration
27
59% / 37%
Overdue
36
13%
Free
4
Developer 4
Rating
(111)
Projects
183
25%
Arbitration
24
17% / 75%
Overdue
16
9%
Free
5
Developer 5
Rating
Projects
0
0%
Arbitration
1
0% / 100%
Overdue
0
Free
6
Developer 6
Rating
(23)
Projects
34
53%
Arbitration
1
100% / 0%
Overdue
1
3%
Free
7
Developer 7
Rating
(4)
Projects
7
57%
Arbitration
1
100% / 0%
Overdue
0
Free
8
Developer 8
Rating
(465)
Projects
815
49%
Arbitration
75
21% / 51%
Overdue
142
17%
Free
9
Developer 9
Rating
(2346)
Projects
2952
63%
Arbitration
125
44% / 26%
Overdue
429
15%
Free
10
Developer 10
Rating
(85)
Projects
174
44%
Arbitration
3
100% / 0%
Overdue
5
3%
Free
Published: 1 code
11
Developer 11
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
12
Developer 12
Rating
(24)
Projects
32
38%
Arbitration
4
50% / 25%
Overdue
5
16%
Working
13
Developer 13
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
14
Developer 14
Rating
(75)
Projects
111
50%
Arbitration
26
31% / 50%
Overdue
9
8%
Free
Published: 1 article
15
Developer 15
Rating
(225)
Projects
285
41%
Arbitration
15
13% / 47%
Overdue
67
24%
Free
16
Developer 16
Rating
(9)
Projects
16
19%
Arbitration
2
0% / 50%
Overdue
3
19%
Loaded
17
Developer 17
Rating
(6)
Projects
13
62%
Arbitration
1
0% / 100%
Overdue
2
15%
Working
18
Developer 18
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
19
Developer 19
Rating
(319)
Projects
571
35%
Arbitration
83
31% / 45%
Overdue
206
36%
Free
20
Developer 20
Rating
(7)
Projects
6
0%
Arbitration
4
25% / 75%
Overdue
2
33%
Free
21
Developer 21
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
22
Developer 22
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
23
Developer 23
Rating
(258)
Projects
269
29%
Arbitration
2
50% / 0%
Overdue
3
1%
Working
Published: 2 codes
24
Developer 24
Rating
(279)
Projects
378
72%
Arbitration
19
32% / 47%
Overdue
16
4%
Free
Published: 15 codes
25
Developer 25
Rating
(28)
Projects
34
35%
Arbitration
0
Overdue
2
6%
Working
26
Developer 26
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
I need an experienced trading-data specialist who can help me obtain 3–4 years of historical market data compatible with NinjaTrader 8 . The data will be used for trading strategy development, backtesting, and analysis
I am looking for an experienced MQL5 developer to develop a custom Expert Advisor (EA) for MetaTrader 5, primarily for XAUUSD (Gold) . The EA will be based on a proprietary price-action trading strategy that I have already defined. The objective is to translate this strategy into a fully automated, precise and reliable trading system without modifying its underlying logic. The strategy involves specific
Need aggressive M1 gold scalper rewrite of Dev3 + 8 strategies. INPUTS: RiskPercent=3, TP=400, SL=300, MaxTrades=6, Mode=BOTH, DailyProfit 15%, DailyLoss -10% LOT = Balance * RiskPercent / 1000 - works for Cent R350 and $1000. 8 STRATEGIES any true = open instantly, check 1 sec: 1 EMA8/21 cross 2 RSI14 30/70 + engulf 3 Engulfing candle 4 BB 20,2 breakout 5 FVG grab M1 6 M5 trend + M1 entry 7 Wick rejection >2 8
I need an experienced MQL5 developer to build a prototype MT5 Expert Advisor called RiskLock. The software should enforce user-defined trading risk rules before trades are executed. It should support risk percentage or fixed monetary risk, calculate position size using account equity, entry price, stop loss, tick value and contract specifications, block or reduce oversized trades, and include daily loss limits
Project Overview I have an existing MT5 Expert Advisor (EA) written in MQL5. The source code ( .mq5 ) will be provided. The underlying strategy is a trend-following system that performs well during trending market conditions, but requires professional quantitative research to improve its ability to identify and avoid highly sideways/range-bound market conditions. The objective of this project is not to build a new EA
Most of the expert is already coded . Create a panel to show the Ratio for the Range . Trigger is based on ratio . Show Distribution / project starts after we clear Distribution
Expert Advisors 300+ USD
double CRiskManager::CalculateLotSize(double slPoints) { double balance = AccountInfoDouble(ACCOUNT_BALANCE); double riskMoney = balance * (m_riskPercent / 100.0); double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE); double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double pointValue = tickValue / tickSize; double lot = riskMoney / (slPoints * pointValue);
i share my strategy i need a bot trending bot fo mt5 . i attached the photo with this it help to make bot. it basicly 1 hours time frame base. i try but failed to make it
Title: Simple background trading bot for my Oanda account (v20 REST API) Overview Hi, I need a simple, lightweight event based standalone trading bot that connects directly to my Oanda account using broker’s standard REST API (V20 account) via VPS The bot just needs to look at group of 5 currency pairs (manually selectable and adjustable) in different 4 baskets, do some basic percentage math every period, and place
MQL5 Developer 30+ USD
📄 وثيقة المواصفات الفنية لروبوت التداول (MQL5 EA Specification) 📌 1. ملخص المشروع والهدف * اسم المشروع: Gold Cent Grid-Hedge EA * المنصة: MetaTrader 5 (MQL5) * أداة التداول: الذهب (XAUUSD) * نوع الحساب: حساب سنت (Cent Account) * فكرة الاستراتيجية: تداول شبكة هيدج متوازنة (Grid-Hedging) تفتح صفقات تعزيز كل مسافة محددة، وتغلق الطرف الأكثر ربحاً عند تحقيق هدف مالّي مجمع بالدولار/السنت لإعادة هيكلة التوازن. ⚙️ 2

Project information

Budget
30 - 40 USD
Deadline
from 1 to 2 day(s)