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
(289)
Proyectos
361
30%
Arbitraje
37
27% / 65%
Caducado
10
3%
Trabajando
Ha publicado: 10 ejemplos
2
Desarrollador 2
Evaluación
(111)
Proyectos
184
25%
Arbitraje
25
16% / 76%
Caducado
16
9%
Libre
3
Desarrollador 3
Evaluación
(22)
Proyectos
21
10%
Arbitraje
4
25% / 75%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(162)
Proyectos
209
61%
Arbitraje
10
80% / 0%
Caducado
0
Libre
Ha publicado: 1 ejemplo
5
Desarrollador 5
Evaluación
(329)
Proyectos
515
19%
Arbitraje
35
46% / 31%
Caducado
34
7%
Trabaja
6
Desarrollador 6
Evaluación
(2)
Proyectos
3
33%
Arbitraje
3
33% / 33%
Caducado
0
Libre
7
Desarrollador 7
Evaluación
(2350)
Proyectos
2956
63%
Arbitraje
125
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
(327)
Proyectos
332
71%
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
(627)
Proyectos
736
34%
Arbitraje
49
53% / 39%
Caducado
15
2%
Trabaja
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
(437)
Proyectos
648
53%
Arbitraje
35
63% / 20%
Caducado
7
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
(369)
Proyectos
459
55%
Arbitraje
24
58% / 17%
Caducado
31
7%
Libre
18
Desarrollador 18
Evaluación
(60)
Proyectos
94
43%
Arbitraje
4
0% / 100%
Caducado
4
4%
Libre
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
(2676)
Proyectos
3418
68%
Arbitraje
77
48% / 14%
Caducado
343
10%
Trabaja
Ha publicado: 1 ejemplo
25
Desarrollador 25
Evaluación
(515)
Proyectos
554
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
Request for an Existing Automated Trading System (Expert Advisor) I am looking to acquire an existing, fully functional Expert Advisor (EA) that trades Forex CFDs, with the option of trading other CFDs if the strategy supports them safely. Performance objectives Target average net monthly return: 1.5%. A consistent 1.0% monthly return may be considered if the system demonstrates strong risk control and credible
Hi All, I am looking for a bot EA which makes good profit. If any having please share it for TEST. After proper TESTING only I will make the payment, no cheating no fraud. Please do not waste the time also
Allow me to set the daily trading bias manually to BUY or SELL. Check my defined 4H and 1H trend-alignment conditions. Execute entries based on my 15-minute pullback and continuation rules. Trade only between 06:00 and 16:00 Nigeria time, Monday to Friday. Calculate lot size based on my chosen risk percentage and stop-loss distance. Automatically place stop-loss and take-profit orders. Enforce my daily trade limits
Rebate robot 30 - 100 USD
Need rebate robot,for pairs like gbpusd,eurusd,usdjpy,usdchf,Spreads are like around 2.5 pip,MAy be better hedge ea both buy and sell,i will get benifit just from rebate,so try ur best to do what i want,and if u r not expert plz go away plz its not simple job,if u already have the robot so i can test it will be surely selected,also u can get some benifit from this screen shoots that i attached,its from another job in
EMA Pin Bar EA 30 - 100 USD
I would like an EA that implements the strategy below: 1. It requires a 6 EMA, 18EMA, 50EMA and 200SMA 2. Trend filter: 50 is above 200 for a buy. 50 below 200 for a sell 3. FOR A BUY: After candle close, if 6 has crossed above 18 and trend filter is a buy: a. if the last candle was a pin bar (body is less than 50% of candle size, and upper wick is less than 10% of candle size) b. check if the candle is within 10
Economic Event Analysis Back ground . I have an app which downloads economic event data from a website called MyFXBook, using a script. But currently this website does not allow any script to be used. So, I have to go back to manually downloading a .csv file that shows the economic events scheduled to occur in the coming week Python . This job requires Python. Execution of this job by any other method that does not
I am looking for an experienced MQL5 developer or development team to build a scalable Telegram-to-MT5 copy trading system. The main purpose of the system is to monitor trading signals from my Telegram channel and automatically execute those signals on connected client MT5 accounts. Core Requirements Receive and parse trading signals from Telegram Automatically execute trades on connected MT5 accounts Support more
Sami 30+ USD
I've built the bot as a single-page app that runs the three-step workflow you described. Since the page can't pull live broker data, it runs on simulated 5-minute candles or on a CSV you paste in.I've published the trading bot page. I haven't opened or run it, so I can't confirm the logic behaves as intended. It runs on simulated 5-minute candles (or a CSV you paste in) and builds the 4H and 30M charts from them. How
Thana ram 30 - 200 USD
Hello, I want to develop a custom MT5 Expert Advisor (EA) for XAUUSD Gold. IMPORTANT: I want a proper rule-based automated trading EA, NOT a martingale, grid or guaranteed-profit bot. 1. MARKET & TIMEFRAME - Platform: MT5 - Symbol: XAUUSD only - Main trend timeframe: M15 - Entry timeframe: M5 - Must support broker suffixes such as XAUUSDm, XAUUSD., etc. 2. TREND RULE BUY trend: - M15 price above EMA 50 - EMA 50 above
Hi, I’m looking for a **ready-made MT5 scalping EA specifically for Gold (XAUUSD)**. My main requirement is an **HTF scalping strategy**, so I’m looking for an existing robot that is already developed and can be tested before I make the purchase. I’m not looking to build one from scratch at this stage. I would like to first test the EA on a **demo account** to see how it performs under live market conditions and

Información sobre el proyecto

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