Range Breakout EA in MQL5 according to spec

Tarea técnica

I am looking for an EA in MQL5 that trades both sides of a range breakout and places a hedge order. Fairly straightforward!

Here is a specification:

Trading Strategy Specification: Range Breakout

Platform: Metatrader 5, Forex brokers

Default Chart: EURUSD, 5m chart

Quick overview

The strategy looks for an established range in the morning session and then trades breakouts above or below that range, by opening either a long trade above the range or a short trade below the range. Take-profit and stop-loss targets are immediately set. If one order has been hit, the other order is immediately terminated. If a trade ends in stop-loss, a hedge trade is opened immediately afterwards

 

Description of Algorithm

Input Parameters

Name

data type

default value

starttime

time

7:00am UTC+1

endtime

time

9:00am UTC+1

minimumrange

number

10 pips

maximumrange

number

150 pips

entrybuffer

number

5%

exitbuffer

number

2%

riskrewardratio

number

2

tradevolume

number

0.05 lots

hedgerangedivider

number

3

hedgevolumemultiplier

number

4

endtime

time

8:00pm UTC+1

Step 1: Establish range in the morning session

Record the highest and the lowest encountered price in the time interval between start time and end time in two variables and calculate the resulting range. Also apply a minimum and maximum range.

High = highest price encountered in interal between starttime and endtime

Low = lowest price encountered in interval between starttime and endtime

Range = High - Low

if Range is higher than maximum range, then set Range = maximumrange

if Range is lower than minimum range, then set Range = minimumrange

Step 2: Trade Entries

Calculate the entry prices by using the range, and a buffer. Set the orders immediately after the time interval of step 1 is over. First, calculate price levels:

bufferrangeentry = range * (1+entrybuffer)

bufferrangeexit = range * (1+exitbuffer)

rangedivider = range / riskrewardratio

Place two pending stop orders with the following parameters:

1) Short Order

Direction: short

Entry Price: Low - bufferrangeentry

stop loss: High + bufferrangeexit

take profit: Entry - rangedivider

2) Long Order:

Direction: long

Entry: High + bufferrangeentry

Set stop loss: Low - bufferrangeexit

Set take profit: Entry + rangedivider


If one of the orders is hit, delete the other open order.

 

Step 3: Hedge Orders

If a stop loss has been hit, on the first opened position, we try to re-coup our losses with a hedge. Therefore a hedge order is placed at the stop-loss of the first opened order. Calculate the range of the hedge:

hedgerange = Range / hedgerangedivider

Place Long Hedge Order if 1st opened position was a short:

Direction: Long

Entry: 1st order stop loss price, immediately after

Stop loss: 1st order entry price

Take Profit: entry + hedgerange

OR

Place Short Hedge Order if 1st opened position was a long:

Direction: Short

Entry: 1st order stop loss price

Set Stop loss: 1st order entry price

set Take Profit: entry - hedgerange

 

Step 4: Close at market price at a time at the end of the day

Close all orders and positions at the given time in the endtime parameter


Han respondido

1
Desarrollador 1
Evaluación
(263)
Proyectos
329
29%
Arbitraje
35
26% / 63%
Caducado
10
3%
Trabaja
2
Desarrollador 2
Evaluación
(108)
Proyectos
176
25%
Arbitraje
24
13% / 75%
Caducado
16
9%
Trabaja
3
Desarrollador 3
Evaluación
(22)
Proyectos
21
10%
Arbitraje
4
25% / 75%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(160)
Proyectos
202
60%
Arbitraje
10
80% / 0%
Caducado
0
Trabaja
Ha publicado: 1 ejemplo
5
Desarrollador 5
Evaluación
(328)
Proyectos
513
19%
Arbitraje
34
44% / 32%
Caducado
34
7%
Trabajando
6
Desarrollador 6
Evaluación
(2)
Proyectos
3
33%
Arbitraje
3
33% / 33%
Caducado
0
Libre
7
Desarrollador 7
Evaluación
(2330)
Proyectos
2934
63%
Arbitraje
124
44% / 26%
Caducado
429
15%
Libre
8
Desarrollador 8
Evaluación
(33)
Proyectos
35
20%
Arbitraje
5
40% / 40%
Caducado
0
Libre
Ha publicado: 1 ejemplo
9
Desarrollador 9
Evaluación
(316)
Proyectos
321
70%
Arbitraje
2
100% / 0%
Caducado
0
Libre
Ha publicado: 1 ejemplo
10
Desarrollador 10
Evaluación
(1)
Proyectos
1
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
11
Desarrollador 11
Evaluación
(6)
Proyectos
7
0%
Arbitraje
2
0% / 100%
Caducado
0
Trabaja
12
Desarrollador 12
Evaluación
(602)
Proyectos
696
33%
Arbitraje
43
47% / 44%
Caducado
12
2%
Ocupado
13
Desarrollador 13
Evaluación
(45)
Proyectos
46
24%
Arbitraje
34
9% / 85%
Caducado
10
22%
Libre
14
Desarrollador 14
Evaluación
Proyectos
0
0%
Arbitraje
1
0% / 0%
Caducado
0
Trabaja
Ha publicado: 2 ejemplos
15
Desarrollador 15
Evaluación
(434)
Proyectos
638
53%
Arbitraje
32
59% / 22%
Caducado
6
1%
Trabaja
16
Desarrollador 16
Evaluación
(5)
Proyectos
8
13%
Arbitraje
3
0% / 33%
Caducado
2
25%
Libre
Ha publicado: 1 ejemplo
17
Desarrollador 17
Evaluación
(365)
Proyectos
439
54%
Arbitraje
22
50% / 14%
Caducado
30
7%
Trabajando
18
Desarrollador 18
Evaluación
(58)
Proyectos
90
43%
Arbitraje
4
0% / 100%
Caducado
3
3%
Trabaja
19
Desarrollador 19
Evaluación
(162)
Proyectos
289
35%
Arbitraje
18
22% / 61%
Caducado
43
15%
Libre
20
Desarrollador 20
Evaluación
(8)
Proyectos
9
56%
Arbitraje
0
Caducado
0
Libre
21
Desarrollador 21
Evaluación
(618)
Proyectos
1429
59%
Arbitraje
31
81% / 0%
Caducado
10
1%
Libre
22
Desarrollador 22
Evaluación
(493)
Proyectos
1022
58%
Arbitraje
30
27% / 23%
Caducado
133
13%
Trabaja
23
Desarrollador 23
Evaluación
(322)
Proyectos
499
67%
Arbitraje
5
40% / 0%
Caducado
4
1%
Libre
Ha publicado: 8 ejemplos
24
Desarrollador 24
Evaluación
(2671)
Proyectos
3404
68%
Arbitraje
77
48% / 14%
Caducado
342
10%
Libre
Ha publicado: 1 ejemplo
25
Desarrollador 25
Evaluación
(513)
Proyectos
552
53%
Arbitraje
13
69% / 15%
Caducado
3
1%
Libre
26
Desarrollador 26
Evaluación
(574)
Proyectos
945
47%
Arbitraje
309
58% / 27%
Caducado
125
13%
Libre
Solicitudes similares
I am looking for an expert MQL5 developer to build a robust, professional Expert Advisor for Gold (XAUUSD). The EA must be Event-Driven (OnTick) with no 'Sleep' functions, ensuring instant execution. ​Core Logic: ​Grid Strategy: Start with 0.02 Buy/Sell. Lot size sequence: 0.02, 0.03, 0.05, 0.09, 0.14, 0.26, 0.44, 0.75, 1.28, 2.18 (Max 10 steps). ​Dynamic TP: Total basket TP must update instantly upon new order
We are seeking talented Graphic Designers capable of transforming concepts into visually striking representations. Whether your expertise lies in branding, marketing materials, or digital graphics, we welcome your application. Our criteria include: - Creativity and originality - Effective communication skills - Prompt delivery of work - A comprehensive and professional portfolio We invite you to submit your portfolio
┌─────────────┐ │ SMC ROBOT │ │ v2.0 │ └─────────────┘ [ANTENNA] │ ╔════════╧════════╗ ║ HEAD UNIT ║ ║ ┌───────────┐ ║ ║ │ ◉ ◉ │ ║ ← Optical Sensors ║ └───────────┘ ║ ╚════════╤════════╝ │ ╔════════╧════════╗ ║ TORSO ║ ║ ┌───────────┐ ║ ║ │ SMC CORE │ ║ ← Processing Unit ║ │ ARM V9 │ ║ ║ └───────────┘ ║ ║ [||||||||||] ║ ← Power Indicator ╚═══╤═══════╤════╝ │ │ ┌───┘ └───┐
I already have the source code of an MT5 Expert Advisor. The EA is about 70% complete. I need someone to modify and complete it. Requirements: • Manage EURUSD only. • Manage manual trades only (Magic Number = 0). • Support unlimited manual positions simultaneously. • Automatically add a 10-pip Stop Loss if a position has no Stop Loss. • Automatically add a 10-pip Take Profit if a position has no Take Profit. • Do not
I am looking for an expert MQL5 developer to build a robust, professional Expert Advisor for Gold (XAUUSD). The EA must be Event-Driven (OnTick) with no 'Sleep' functions, ensuring instant execution. ​ Core Logic: ​ Grid Strategy: Start with 0.02 Buy/Sell. Lot size sequence: 0.02, 0.03, 0.05, 0.09, 0.14, 0.26, 0.44, 0.75, 1.28, 2.18 (Max 10 steps). ​ Dynamic TP: Total basket TP must update instantly upon new order
SETJEO'S GOLD EA 30 - 200 USD
double GetTodayProfit() { double profit = 0; datetime today = StringToTime(TimeToString(TimeCurrent(), TIME_DATE)); HistorySelect(today, TimeCurrent()); for(int i = HistoryDealsTotal() - 1; i >= 0; i--) { ulong ticket = HistoryDealGetTicket(i); if(HistoryDealGetString(ticket, DEAL_SYMBOL) == _Symbol) { profit += HistoryDealGetDouble(ticket, DEAL_PROFIT); } } return profit; }
I have an expert advisor's investor login. I want you to study it and make me the exact same EA. There should be absolutely no differences or mistakes. You should have great observation skills for this aswell
I am looking for a developer to create an Expert Advisor (EA) for MetaTrader 5. Requirements: Trade XAUUSD (Gold) Automatically open and close trades Include Stop Loss and Take Profit settings Adjustable lot size and risk percentage Work on MT5 Allow me to change settings from the EA inputs Include backtesting support Source code preferred
I have build a trading view indicator which monitors trades. The strategy is based on OB, it buys and sells bullish and bearish OB. Also valid re enters on the retest of orderblocks only if TP is hit the first time. I’m looking for someone to develop me a EA which works on the same logic and buys and sells of the same logic as my Indicator. I currently have my indicator firing signals into a telegram channel so I
I am looking for an experienced MQL5 developer to code a simple grid trading strategy into an Expert Advisor. The strategy logic is already defined, and I am looking for someone with strong MQL5 development experience to implement it accurately and efficiently. If you are interested and have relevant experience, please get in touch so we can discuss the project details

Información sobre el proyecto

Presupuesto
100 - 200 USD
Plazo límite de ejecución
a 5 día(s)