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

Trabajo finalizado

Plazo de ejecución 48 días

Tarea técnica

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).


Han respondido

1
Desarrollador 1
Evaluación
(394)
Proyectos
555
41%
Arbitraje
30
57% / 3%
Caducado
57
10%
Libre
Ha publicado: 11 ejemplos
2
Desarrollador 2
Evaluación
(16)
Proyectos
20
15%
Arbitraje
5
40% / 40%
Caducado
0
Libre
3
Desarrollador 3
Evaluación
(274)
Proyectos
403
28%
Arbitraje
40
40% / 50%
Caducado
1
0%
Libre
4
Desarrollador 4
Evaluación
(23)
Proyectos
34
53%
Arbitraje
1
100% / 0%
Caducado
1
3%
Libre
5
Desarrollador 5
Evaluación
(4)
Proyectos
8
0%
Arbitraje
3
33% / 67%
Caducado
4
50%
Libre
6
Desarrollador 6
Evaluación
(2)
Proyectos
2
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
7
Desarrollador 7
Evaluación
(31)
Proyectos
33
42%
Arbitraje
0
Caducado
3
9%
Libre
8
Desarrollador 8
Evaluación
(510)
Proyectos
977
74%
Arbitraje
27
19% / 67%
Caducado
100
10%
Libre
Ha publicado: 1 artículo, 6 ejemplos
9
Desarrollador 9
Evaluación
(258)
Proyectos
267
30%
Arbitraje
0
Caducado
3
1%
Trabaja
Ha publicado: 2 ejemplos
10
Desarrollador 10
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
11
Desarrollador 11
Evaluación
(7)
Proyectos
13
15%
Arbitraje
13
23% / 46%
Caducado
3
23%
Libre
Ha publicado: 35 artículos
12
Desarrollador 12
Evaluación
(7)
Proyectos
6
0%
Arbitraje
4
25% / 75%
Caducado
2
33%
Libre
13
Desarrollador 13
Evaluación
(2672)
Proyectos
3407
68%
Arbitraje
77
48% / 14%
Caducado
342
10%
Libre
Ha publicado: 1 ejemplo
14
Desarrollador 14
Evaluación
(6)
Proyectos
7
14%
Arbitraje
1
0% / 100%
Caducado
1
14%
Libre
15
Desarrollador 15
Evaluación
(2)
Proyectos
3
0%
Arbitraje
0
Caducado
0
Libre
16
Desarrollador 16
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
17
Desarrollador 17
Evaluación
(365)
Proyectos
441
55%
Arbitraje
22
50% / 14%
Caducado
30
7%
Trabajando
18
Desarrollador 18
Evaluación
(7)
Proyectos
5
0%
Arbitraje
5
0% / 80%
Caducado
1
20%
Trabaja
19
Desarrollador 19
Evaluación
(22)
Proyectos
29
34%
Arbitraje
4
50% / 25%
Caducado
5
17%
Trabaja
20
Desarrollador 20
Evaluación
Proyectos
0
0%
Arbitraje
2
0% / 100%
Caducado
0
Libre
21
Desarrollador 21
Evaluación
(62)
Proyectos
90
29%
Arbitraje
24
13% / 58%
Caducado
7
8%
Trabaja
22
Desarrollador 22
Evaluación
(64)
Proyectos
83
28%
Arbitraje
9
33% / 56%
Caducado
9
11%
Libre
Ha publicado: 1 ejemplo
23
Desarrollador 23
Evaluación
(2334)
Proyectos
2937
63%
Arbitraje
124
44% / 26%
Caducado
429
15%
Libre
24
Desarrollador 24
Evaluación
(2)
Proyectos
3
33%
Arbitraje
1
0% / 100%
Caducado
0
Libre
25
Desarrollador 25
Evaluación
(19)
Proyectos
31
32%
Arbitraje
8
50% / 25%
Caducado
3
10%
Trabaja
26
Desarrollador 26
Evaluación
(73)
Proyectos
257
53%
Arbitraje
16
50% / 38%
Caducado
83
32%
Libre
27
Desarrollador 27
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
28
Desarrollador 28
Evaluación
Proyectos
2
0%
Arbitraje
0
Caducado
1
50%
Libre
29
Desarrollador 29
Evaluación
(1)
Proyectos
2
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
Ha publicado: 2 ejemplos
30
Desarrollador 30
Evaluación
(5)
Proyectos
7
29%
Arbitraje
1
100% / 0%
Caducado
2
29%
Libre
31
Desarrollador 31
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
32
Desarrollador 32
Evaluación
(20)
Proyectos
26
38%
Arbitraje
6
33% / 50%
Caducado
0
Libre
33
Desarrollador 33
Evaluación
(144)
Proyectos
186
41%
Arbitraje
24
58% / 21%
Caducado
13
7%
Libre
34
Desarrollador 34
Evaluación
(202)
Proyectos
263
22%
Arbitraje
23
52% / 17%
Caducado
0
Trabajando
35
Desarrollador 35
Evaluación
(55)
Proyectos
92
24%
Arbitraje
8
75% / 13%
Caducado
44
48%
Libre
36
Desarrollador 36
Evaluación
(3)
Proyectos
1
100%
Arbitraje
3
0% / 100%
Caducado
0
Libre
37
Desarrollador 37
Evaluación
(44)
Proyectos
51
59%
Arbitraje
2
100% / 0%
Caducado
1
2%
Libre
Ha publicado: 5 ejemplos
38
Desarrollador 38
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
39
Desarrollador 39
Evaluación
(10)
Proyectos
14
43%
Arbitraje
0
Caducado
3
21%
Libre
40
Desarrollador 40
Evaluación
(4)
Proyectos
4
0%
Arbitraje
0
Caducado
0
Trabaja
41
Desarrollador 41
Evaluación
(2)
Proyectos
7
0%
Arbitraje
3
0% / 33%
Caducado
1
14%
Trabaja
42
Desarrollador 42
Evaluación
(1)
Proyectos
1
0%
Arbitraje
0
Caducado
0
Libre
43
Desarrollador 43
Evaluación
(271)
Proyectos
553
50%
Arbitraje
57
40% / 37%
Caducado
227
41%
Trabaja
44
Desarrollador 44
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
45
Desarrollador 45
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
Hello I need to purchase the source code of an already built profitable mt5 EA with proven track recordIf you have something similar and you are open to selling the source code please apply to this post Please note I am not looking for a dev to build the product from scratch , but need something that is already built and have at least one year worth of track record
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 or broker clock. 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell/buy at 50% of the FVG 7. SL: 10 pips above
Code An Loss Rate 90-100% MT5 EA , that can blow a 100 USD account a day ,with fixed TP of 3000 points and SL of 3000 For better Rate Calculations get an strategy that can lead to so
Shooter razor 30+ USD
Makes it takes trades by it self buy and sell, it must use the higher signals, also when I press stop it must not pick any trades I want it to take trades automatically when I press start also close by it self
8 cap prop firm passing 30 - 3000 USD
I am looking for an experienced MQL4/MQL5 HFT developer to build or optimize a High-Frequency Trading (HFT) Expert Advisor that can successfully pass proprietary trading firm challenges and perform consistently under live trading conditions with brokers such as 8cap or BlackBull Markets . The developer should have proven experience with HFT execution, ultra-low-latency trading, broker execution, slippage, spreads
I need a professional MT5 Expert Advisor (MQL5) for XAU/USD (Gold) only. Requirements: - Symbol: XAU/USD only - Timeframe: H1 trend, M5 entry - Smart Money Concept (SMC) - Liquidity Sweep - Break of Structure (BOS) - Order Block Retest - Confirmation Candle (Engulfing or Pin Bar) - ATR-based Stop Loss - Risk:Reward = 1:3 (adjustable) - Auto Lot (1% risk) - Break Even - Trailing Stop - Maximum 2 trades per day - One
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 designed primarily for US30 (Dow Jones Index) . The EA performs consistently and profitably on demo accounts, but when I run it on an IC Markets Raw or Standard live account, it starts generating losses under what appear to be the same trading conditions. At this time, I cannot provide the source code (.mq4/.mq5). I can only provide the
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell at 50% of the FVG 7. SL: 10 pips above sweep wick 8. TP: 2R
Hello looking for someone to convert an indicator from tradingview to Thinkorswim I have attached the codes from trading view Also, I like make it trigger (alert) a one-time alert when the trend changes, and can also create a custom watchlist column that flags symbols currently in a new trend so you can scan multiple stocks easily. And like the watchlist to show only fresh trend changes or the current trend direction
I want to build a fundamental news trading bot that trade off economic news data, as we know every economic news data released always have effect on the asset associated with it, so this bot will take a trade instantly based on the news data released either to buy or sell, it will come with good money management and also SL and TP target based on price and pips value

Información sobre el proyecto

Presupuesto
100+ USD