Robust MT5 Supertrend Trend‑Following EA With Full Risk Management (Including Breakeven)

Lavoro terminato

Tempo di esecuzione 48 giorni

Specifiche

1. Goal

I want a MetaTrader 5 Expert Advisor that trades a simple Supertrend trend‑following idea, but with professional‑grade risk management and filters. It should be robust enough for real money on instruments like XAUUSD and GBP pairs, using small, consistent risk per trade rather than martingale or grid.

2. Strategy Logic

Indicators (I will supply the .mq5 files if needed):

  • Supertrend (ATR‑based), with adjustable:

    • ATR period

    • ATR multiplier

  • Optional DEMA (trend filter), with adjustable period.

Signal and trend rules:

  • Use closed candles only (no intra‑bar decisions).

  • On each new bar:

    • Read Supertrend direction on bar 1 (just closed) and bar 2 (previous).

    • Direction = +1 (uptrend) or −1 (downtrend).

  • Entry:

    • If direction flips from −1 to +1 and trend filter allows longs → open buy.

    • If direction flips from +1 to −1 and trend filter allows shorts → open sell.

  • Trend filter:

    • Input  Use_DEMA_Filter  (true/false).

    • If true:

      • Only buy if price is above DEMA (and optionally DEMA is flat or rising).

      • Only sell if price is below DEMA (and optionally DEMA is flat or falling).

    • If false:

      • Ignore DEMA and trade purely on Supertrend.

Position logic:

  • Only one position per symbol per magic number.

  • Input  Reverse_On_Signal :

    • If true: on opposite signal, close existing trade and immediately open in the new direction.

    • If false: on opposite signal, close trade only (no immediate reverse).


3. Risk Management (non‑negotiable)

3.1 Lot sizing

  • Use_Risk_Percent  (true/false).

  • If false → use fixed lot  Lots .

  • If true → calculate lot size from  Risk_Percent_Per_Trade  (e.g. 0.5–2%) based on distance from entry to initial SL, using standard percentage‑risk money management.

3.2 Stop loss / take profit

  • The EA must always be able to run with a real stop‑loss. No martingale, no grid, no averaging down or “recovery” systems.

  • SL modes (selectable input  SL_Mode ):

    • 1 = fixed SL in points.

    • 2 = SL at or just beyond the Supertrend line at entry.

    • 3 = ATR‑based SL (multiple of ATR).

  • TP modes ( TP_Mode ):

    • 0 = no hard TP (exit via opposite signal or trailing).

    • 1 = fixed TP in points.

    • 2 = RR multiple (e.g. 2R, 3R) based on initial SL.

3.3 Breakeven rule (10‑pip to entry)

Implement a breakeven mechanism:

  • Inputs:

    • Use_Breakeven  (true/false)

    • Breakeven_Trigger_Points  (default value 100 points on 5‑digit quotes = 10 pips; I can adjust later)

Behaviour:

  • When  Use_Breakeven = true , once the trade is in profit by at least  Breakeven_Trigger_Points , move the stop loss to exact entry price (no extra buffer).

  • This should happen once per trade; after SL is moved to breakeven, do not move it back even if price retraces.

3.4 Trailing stop

  • Option  Use_ST_Trailing :

    • If enabled, trail SL on each new bar using the current Supertrend value in favour of the trade, never loosening it.

  • Optional standard trailing stop:

    • Inputs like  Use_Classic_Trailing ,  Classic_Trail_Start ,  Classic_Trail_Step .

  • Trailing should co‑exist logically with the breakeven rule (i.e. breakeven first, then trailing can continue to move SL further into profit).

3.5 Session & filter controls

  • Use_Session_Filter  (true/false).

  • Inputs for at least one session window:

    • Session_Start_Hour ,  Session_End_Hour  (server time).

    • Optional second window:  Session2_Start_Hour ,  Session2_End_Hour .

  • Rules:

    • No new trades outside permitted hours.

    • EA should still manage existing trades (breakeven, trailing, exits) outside session unless an input  Close_Outside_Session  is set true.

  • Day‑of‑week switches (Mon–Fri on/off).

3.6 Spread / slippage / safety

  • Max_Spread_Points  – block new trades if current spread exceeds this.

  • Slippage  – maximum allowed slippage for market orders.

  • Optional equity protection:

    • Daily_Max_Loss_Percent  and/or  Overall_Max_Loss_Percent .

    • When hit, EA must stop opening new trades for that day (or until reset), with a clear comment/log message.


4. Inputs Summary (minimum)

  • General:

    • Lots ,  Use_Risk_Percent ,  Risk_Percent_Per_Trade ,  Magic_Number ,  Trade_Comment .

  • Supertrend:

    • ST_ATR_Period ,  ST_ATR_Multiplier .

  • DEMA:

    • Use_DEMA_Filter ,  DEMA_Period .

  • Risk:

    • SL_Mode ,  SL_Fixed_Points ,  SL_ATR_Multiplier .

    • TP_Mode ,  TP_Fixed_Points ,  TP_R_Multiple .

    • Use_ST_Trailing ,  Use_Classic_Trailing ,  Classic_Trail_Start ,  Classic_Trail_Step .

    • Use_Breakeven ,  Breakeven_Trigger_Points  (default 100 points ≈ 10 pips).

    • Max_Spread_Points ,  Slippage .

    • Optional:  Daily_Max_Loss_Percent ,  Overall_Max_Loss_Percent .

  • Session:

    • Use_Session_Filter ,  Session_Start_Hour ,  Session_End_Hour , optional second session, weekday on/off.

  • Behaviour:

    • Reverse_On_Signal ,  Close_Outside_Session .


5. Technical Requirements

  • Platform: MetaTrader 5, language MQL5.

  • Delivery: full source code ( .mq5 ).

  • No external DLLs or paid libraries.

  • No martingale / grid / hedging‑recovery logic. Straight single‑position trend‑following only.

  • Code must:

    • Compile with no errors and no serious warnings.

    • Be clearly structured with functions for:

      • Reading indicators

      • Generating signals

      • Position sizing

      • Opening/closing trades

      • Breakeven and trailing logic

  • Include light comments, especially around:

    • Supertrend / DEMA buffer mapping

    • Entry/exit logic

    • Breakeven and trailing implementation.


6. Testing & Deliverables

  • Please test the EA in Strategy Tester on at least:

    • One FX pair

    • One volatile instrument (e.g. XAUUSD)

I don’t need optimisation; I just need confirmation that:

  • Entries occur only after a confirmed Supertrend flip on candle close.

  • DEMA filter, session filter, spread filter work as described.

  • SL/TP modes, breakeven at 10 pips, and trailing all behave correctly.

Deliverables:

  • Final  .mq5  EA source file.

  • Short note describing:

    • Which indicator buffers are used.

    • How risk (SL/TP, breakeven, trailing) is implemented.

    • Any assumptions about account type (hedging vs netting).


Con risposta

1
Sviluppatore 1
Valutazioni
(395)
Progetti
556
41%
Arbitraggio
30
57% / 3%
In ritardo
57
10%
Gratuito
Pubblicati: 11 codici
2
Sviluppatore 2
Valutazioni
(17)
Progetti
21
19%
Arbitraggio
5
40% / 40%
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
(274)
Progetti
403
28%
Arbitraggio
40
40% / 50%
In ritardo
1
0%
Gratuito
4
Sviluppatore 4
Valutazioni
(23)
Progetti
34
53%
Arbitraggio
1
100% / 0%
In ritardo
1
3%
Gratuito
5
Sviluppatore 5
Valutazioni
(4)
Progetti
8
0%
Arbitraggio
3
33% / 67%
In ritardo
4
50%
Gratuito
6
Sviluppatore 6
Valutazioni
(2)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(33)
Progetti
34
41%
Arbitraggio
0
In ritardo
3
9%
Gratuito
8
Sviluppatore 8
Valutazioni
(510)
Progetti
977
74%
Arbitraggio
27
19% / 67%
In ritardo
100
10%
In elaborazione
Pubblicati: 1 articolo, 6 codici
9
Sviluppatore 9
Valutazioni
(258)
Progetti
269
29%
Arbitraggio
1
100% / 0%
In ritardo
3
1%
In elaborazione
Pubblicati: 2 codici
10
Sviluppatore 10
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
(7)
Progetti
13
15%
Arbitraggio
13
23% / 46%
In ritardo
3
23%
Gratuito
Pubblicati: 38 articoli
12
Sviluppatore 12
Valutazioni
(7)
Progetti
6
0%
Arbitraggio
4
25% / 75%
In ritardo
2
33%
Gratuito
13
Sviluppatore 13
Valutazioni
(2675)
Progetti
3414
68%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
Gratuito
Pubblicati: 1 codice
14
Sviluppatore 14
Valutazioni
(6)
Progetti
7
14%
Arbitraggio
1
0% / 100%
In ritardo
1
14%
Gratuito
15
Sviluppatore 15
Valutazioni
(2)
Progetti
3
0%
Arbitraggio
0
In ritardo
0
Gratuito
16
Sviluppatore 16
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
17
Sviluppatore 17
Valutazioni
(366)
Progetti
449
55%
Arbitraggio
23
57% / 17%
In ritardo
30
7%
Caricato
18
Sviluppatore 18
Valutazioni
(7)
Progetti
5
0%
Arbitraggio
5
0% / 80%
In ritardo
1
20%
In elaborazione
19
Sviluppatore 19
Valutazioni
(24)
Progetti
32
38%
Arbitraggio
4
50% / 25%
In ritardo
5
16%
In elaborazione
20
Sviluppatore 20
Valutazioni
Progetti
0
0%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
21
Sviluppatore 21
Valutazioni
(62)
Progetti
90
29%
Arbitraggio
24
13% / 58%
In ritardo
7
8%
In elaborazione
22
Sviluppatore 22
Valutazioni
(64)
Progetti
83
28%
Arbitraggio
9
33% / 56%
In ritardo
9
11%
Gratuito
Pubblicati: 1 codice
23
Sviluppatore 23
Valutazioni
(2346)
Progetti
2951
63%
Arbitraggio
125
44% / 26%
In ritardo
429
15%
Gratuito
24
Sviluppatore 24
Valutazioni
(2)
Progetti
3
33%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
25
Sviluppatore 25
Valutazioni
(19)
Progetti
31
32%
Arbitraggio
8
50% / 25%
In ritardo
3
10%
In elaborazione
26
Sviluppatore 26
Valutazioni
(73)
Progetti
257
53%
Arbitraggio
16
50% / 38%
In ritardo
83
32%
Gratuito
27
Sviluppatore 27
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
28
Sviluppatore 28
Valutazioni
Progetti
2
0%
Arbitraggio
0
In ritardo
1
50%
Gratuito
29
Sviluppatore 29
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 2 codici
30
Sviluppatore 30
Valutazioni
(6)
Progetti
8
38%
Arbitraggio
1
100% / 0%
In ritardo
2
25%
Gratuito
31
Sviluppatore 31
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
32
Sviluppatore 32
Valutazioni
(20)
Progetti
26
38%
Arbitraggio
6
33% / 50%
In ritardo
0
Gratuito
33
Sviluppatore 33
Valutazioni
(144)
Progetti
186
41%
Arbitraggio
24
58% / 21%
In ritardo
13
7%
Gratuito
34
Sviluppatore 34
Valutazioni
(209)
Progetti
272
21%
Arbitraggio
24
54% / 17%
In ritardo
0
Gratuito
35
Sviluppatore 35
Valutazioni
(55)
Progetti
92
24%
Arbitraggio
8
75% / 13%
In ritardo
44
48%
Gratuito
36
Sviluppatore 36
Valutazioni
(3)
Progetti
1
100%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
37
Sviluppatore 37
Valutazioni
(45)
Progetti
53
57%
Arbitraggio
2
100% / 0%
In ritardo
1
2%
Gratuito
Pubblicati: 5 codici
38
Sviluppatore 38
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
39
Sviluppatore 39
Valutazioni
(10)
Progetti
14
43%
Arbitraggio
0
In ritardo
3
21%
Gratuito
40
Sviluppatore 40
Valutazioni
(4)
Progetti
5
0%
Arbitraggio
0
In ritardo
0
Gratuito
41
Sviluppatore 41
Valutazioni
(2)
Progetti
7
0%
Arbitraggio
3
0% / 33%
In ritardo
1
14%
In elaborazione
42
Sviluppatore 42
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
0
In ritardo
0
Gratuito
43
Sviluppatore 43
Valutazioni
(271)
Progetti
553
50%
Arbitraggio
57
40% / 37%
In ritardo
227
41%
In elaborazione
44
Sviluppatore 44
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
45
Sviluppatore 45
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
I need an MT5 Expert Advisor for XAUUSD (Gold) running on an Exness account. STRATEGY LOGIC The exact entry and exit rules will be provided in writing before development starts. Please quote for a single rule-based strategy with clearly separated logic, so the rules can be adjusted later without rewriting the whole EA. RISK MANAGEMENT (this is the priority of the project) - Risk per trade as a percentage of account
Modification of Trade_Panel_7 7.05 Objective . I have this utility “Trade_Panel_7 7.05” with which I open and close positions. Please refer to attached “Trade Panel Modification.jpg”. It shows an input parameter “Volume Step”. This parameter has the initial value of 0.02 as shown. This feature needs to be amended. Present Status . Value of lot size is increased by this “Volume Step”. I have built a whole series of
Hello Traders, Have a trading strategy or idea you want to automate? I specialize exclusively in MQL5 development, helping traders turn their concepts into professional trading solutions. Custom Expert Advisors — automate your strategy and reduce manual execution Custom Indicators — transform your market ideas into powerful trading tools Fix & Debug — identify errors and get your existing code working properly
please share: Strategy description — entry/exit rules, indicators used, timeframe(s), and instrument(s) (a written explanation, screenshots, or an existing indicator/EA to reference all work) Risk management rules — position sizing method (fixed lot / % risk), stop loss / take profit logic, max drawdown or daily loss limits, and whether martingale/grid/hedging is involved Broker & account details — broker name
I need a unique grid trading system for XAUUSD that combines entry, controlled two-sided grid expansion, DCA (Dollar Cost Averaging) basket profit control, hedging. Unlike traditional grid EAs that only trade against price, this unique grid system should dynamically build positions in both directions based on market movement, allowing flexible adaptation to changing conditions ie the grid needs to dynamically move
I need an experienced MQL5 developer to create a fully automated MT5 Expert Advisor called Ayoub Gold EA , focused exclusively on XAUUSD (Gold) . Main requirements: Platform: MT5 / MQL5. Fully automated BUY and SELL trading on XAUUSD. Must support broker suffixes such as XAUUSD, XAUUSD.f and XAUUSDm. Trading strategy based mainly on Range Breakout with trend confirmation. EMA, ADX and ATR filters. London/New York
Mashiri 50 - 10000 USD
I need a custom MetaTrader 5 indicator designed specifically for XAUUSD gold trading. The indicator should identify potential buy and sell opportunities, display clear entry and exit signals on the chart, provide alerts, and help identify market trends and possible reversals
Looking for an experienced Sierra Chart ACSIL/C++ developer to customize an existing footprint chart. I need 3 things: 7-Day ATR – calculate and display a configurable 7-day ATR. Custom Footprint – modify my existing footprint chart to match my preferred layout/data display. Automatic LVN – detect and plot Low Volume Nodes automatically based on volume distribution. I already have a working footprint chart, so no
//———————————————————————————————————————————————————————————————————— struct S_MCAV { double matureSum; double totalSum; double value; void Init () { matureSum = 0.0; totalSum = 0.0; value = 0.5; } void AddContext (int ctx) { totalSum += 1.0; if (ctx == 1) matureSum += 1.0; } void ApplyDecay (double rate) { matureSum *= rate; totalSum *= rate; } void Update () {
1. Title Development of a Custom MQL5 Expert Advisor for XAUUSD (MetaTrader 5) 2. Requirements Specification Overview: I am looking for an experienced MQL5 developer to build a robust, fully custom Expert Advisor (EA) for MetaTrader 5 tailored for trading Gold (XAUUSD). Core Specifications & Features: Asset & Timeframe: Designed specifically for XAUUSD. Timeframe should be selectable directly from the EA inputs

Informazioni sul progetto

Budget
100+ USD