Range Breakout EA in MQL5 according to spec

Specification

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


Responded

1
Developer 1
Rating
(289)
Projects
361
30%
Arbitration
37
27% / 65%
Overdue
10
3%
Loaded
Published: 10 codes
2
Developer 2
Rating
(111)
Projects
184
25%
Arbitration
25
16% / 76%
Overdue
16
9%
Free
3
Developer 3
Rating
(22)
Projects
21
10%
Arbitration
4
25% / 75%
Overdue
0
Free
4
Developer 4
Rating
(162)
Projects
209
61%
Arbitration
10
80% / 0%
Overdue
0
Free
Published: 1 code
5
Developer 5
Rating
(329)
Projects
515
19%
Arbitration
35
46% / 31%
Overdue
34
7%
Working
6
Developer 6
Rating
(2)
Projects
3
33%
Arbitration
3
33% / 33%
Overdue
0
Free
7
Developer 7
Rating
(2350)
Projects
2956
63%
Arbitration
125
44% / 26%
Overdue
429
15%
Free
8
Developer 8
Rating
(33)
Projects
35
20%
Arbitration
5
40% / 40%
Overdue
0
Free
Published: 1 code
9
Developer 9
Rating
(327)
Projects
332
71%
Arbitration
2
100% / 0%
Overdue
0
Free
Published: 1 code
10
Developer 10
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
11
Developer 11
Rating
(6)
Projects
7
0%
Arbitration
2
0% / 100%
Overdue
0
Working
12
Developer 12
Rating
(627)
Projects
736
34%
Arbitration
49
53% / 39%
Overdue
15
2%
Working
13
Developer 13
Rating
(45)
Projects
46
24%
Arbitration
34
9% / 85%
Overdue
10
22%
Free
14
Developer 14
Rating
Projects
0
0%
Arbitration
1
0% / 0%
Overdue
0
Working
Published: 2 codes
15
Developer 15
Rating
(437)
Projects
648
53%
Arbitration
35
63% / 20%
Overdue
7
1%
Working
16
Developer 16
Rating
(5)
Projects
8
13%
Arbitration
3
0% / 33%
Overdue
2
25%
Free
Published: 1 code
17
Developer 17
Rating
(369)
Projects
459
55%
Arbitration
24
58% / 17%
Overdue
31
7%
Free
18
Developer 18
Rating
(60)
Projects
94
43%
Arbitration
4
0% / 100%
Overdue
4
4%
Free
19
Developer 19
Rating
(162)
Projects
289
35%
Arbitration
18
22% / 61%
Overdue
43
15%
Free
20
Developer 20
Rating
(8)
Projects
9
56%
Arbitration
0
Overdue
0
Free
21
Developer 21
Rating
(618)
Projects
1429
59%
Arbitration
31
81% / 0%
Overdue
10
1%
Free
22
Developer 22
Rating
(493)
Projects
1022
58%
Arbitration
30
27% / 23%
Overdue
133
13%
Working
23
Developer 23
Rating
(322)
Projects
499
67%
Arbitration
5
40% / 0%
Overdue
4
1%
Free
Published: 8 codes
24
Developer 24
Rating
(2676)
Projects
3418
68%
Arbitration
77
48% / 14%
Overdue
343
10%
Working
Published: 1 code
25
Developer 25
Rating
(515)
Projects
554
53%
Arbitration
13
69% / 15%
Overdue
3
1%
Free
26
Developer 26
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
Similar orders
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

Project information

Budget
100 - 200 USD
Deadline
to 5 day(s)