Range Breakout EA in MQL5 according to spec

Техническое задание

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


Откликнулись

1
Разработчик 1
Оценка
(241)
Проекты
303
28%
Арбитраж
33
24% / 61%
Просрочено
9
3%
Занят
2
Разработчик 2
Оценка
(103)
Проекты
160
22%
Арбитраж
23
9% / 78%
Просрочено
16
10%
Загружен
3
Разработчик 3
Оценка
(22)
Проекты
21
10%
Арбитраж
4
25% / 75%
Просрочено
0
Свободен
4
Разработчик 4
Оценка
(152)
Проекты
190
57%
Арбитраж
10
80% / 0%
Просрочено
0
Свободен
Опубликовал: 1 пример
5
Разработчик 5
Оценка
(323)
Проекты
502
19%
Арбитраж
33
42% / 30%
Просрочено
33
7%
Загружен
6
Разработчик 6
Оценка
(2)
Проекты
3
33%
Арбитраж
3
33% / 33%
Просрочено
0
Свободен
7
Разработчик 7
Оценка
(2293)
Проекты
2887
63%
Арбитраж
122
44% / 25%
Просрочено
428
15%
Работает
8
Разработчик 8
Оценка
(33)
Проекты
35
20%
Арбитраж
5
40% / 40%
Просрочено
0
Свободен
Опубликовал: 1 пример
9
Разработчик 9
Оценка
(302)
Проекты
308
69%
Арбитраж
2
100% / 0%
Просрочено
0
Свободен
Опубликовал: 1 пример
10
Разработчик 10
Оценка
(1)
Проекты
1
0%
Арбитраж
1
0% / 100%
Просрочено
0
Свободен
11
Разработчик 11
Оценка
(6)
Проекты
7
0%
Арбитраж
2
0% / 100%
Просрочено
0
Работает
12
Разработчик 12
Оценка
(540)
Проекты
622
33%
Арбитраж
37
38% / 51%
Просрочено
11
2%
Занят
13
Разработчик 13
Оценка
(45)
Проекты
46
24%
Арбитраж
34
9% / 85%
Просрочено
10
22%
Свободен
14
Разработчик 14
Оценка
Проекты
0
0%
Арбитраж
1
0% / 0%
Просрочено
0
Работает
Опубликовал: 2 примера
15
Разработчик 15
Оценка
(428)
Проекты
623
54%
Арбитраж
30
53% / 23%
Просрочено
6
1%
Занят
16
Разработчик 16
Оценка
(5)
Проекты
8
13%
Арбитраж
3
0% / 33%
Просрочено
2
25%
Свободен
Опубликовал: 1 пример
17
Разработчик 17
Оценка
(333)
Проекты
401
52%
Арбитраж
20
55% / 15%
Просрочено
29
7%
Загружен
18
Разработчик 18
Оценка
(57)
Проекты
89
43%
Арбитраж
4
0% / 100%
Просрочено
3
3%
Работает
19
Разработчик 19
Оценка
(159)
Проекты
284
35%
Арбитраж
18
22% / 61%
Просрочено
42
15%
Загружен
20
Разработчик 20
Оценка
(8)
Проекты
9
56%
Арбитраж
0
Просрочено
0
Свободен
21
Разработчик 21
Оценка
(617)
Проекты
1427
59%
Арбитраж
31
81% / 0%
Просрочено
10
1%
Свободен
22
Разработчик 22
Оценка
(493)
Проекты
1022
58%
Арбитраж
30
27% / 23%
Просрочено
133
13%
Работает
23
Разработчик 23
Оценка
(322)
Проекты
499
67%
Арбитраж
5
40% / 0%
Просрочено
4
1%
Свободен
Опубликовал: 8 примеров
24
Разработчик 24
Оценка
(2629)
Проекты
3341
67%
Арбитраж
77
48% / 14%
Просрочено
342
10%
Свободен
Опубликовал: 1 пример
25
Разработчик 25
Оценка
(511)
Проекты
549
53%
Арбитраж
13
69% / 15%
Просрочено
3
1%
Свободен
26
Разработчик 26
Оценка
(574)
Проекты
945
47%
Арбитраж
309
58% / 27%
Просрочено
125
13%
Свободен
Похожие заказы
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
Hi developers, I need someone to help me create a simple EA with my indicators and trading plan... I will give you all parameters and you help me create... 2 moving averages, one candle pattern
Please a need a very good expert for this jou I want to create 2 robot one a trade manager Perfect — here’s a clean, professional order description you can post directly to an EA freelancer (MQL5). I’ve written it so it’s clear, serious, and attractive to skilled developers 👌 MQL5 Trade Manager EA – Development Request I am looking for an experienced MQL5 developer to build a robust Trade Manager Expert Advisor for
Henryy999 30 - 3000 USD
The Ai robot must help me with forex and I don't have money soon can the Ai robot give me some money and I will pay it back if the Ai robot does a good job making me rich
Project Title: MT5 Algo Trading EA (Single Strategy + License Panel + Ownership + Manual Trade) --- Project Description I am looking for an experienced MT5 (MQL5) developer to create a clean, stable and professional Algo Trading EA for my company and future clients. This is a long-term business project, not a one-time personal EA. --- 1. Strategy Requirements - Only 1 single trading strategy - No martingale - No grid
I am looking for an experienced StrategyQuant X (SQX) developer to build a reusable trading template , not a single strategy. ⚠️ Please do NOT apply unless you actively use StrategyQuant X and have access to it. This project cannot be completed without SQX. 1. Session and Time Filters Trading restricted to fixed GMT sessions per index Sessions must convert correctly to broker server time and remain correct through
Is there someone who coded the PipJuice indicator? Here is the link: https://www.pipjuice.io/ Unfortunately, I don‘t have access to the indicator or the code. If someone have it please send me some screenshots
Strategy Development: Suggest a high-probability trading strategy based on Technical Analysis (using indicators like RSI, MACD, or Price Action). Risk Management: Explain how to calculate position sizing so I don't lose more than 1-2% of my capital per trade. Market Analysis: Teach me how to identify Support and Resistance levels and how to spot a trend reversal. Psychology: Give me 5 golden rules to maintain
A Grid EA with a hedge that open trades on a percentage based on whats is opened on the other side, closes losing trades with current profits made and utilizes a grid trading strategy combined with hedging technique to mitigate risk and potentially lock in profits. It involves placing buy and sell orders at predetermined price intervals, forming a grid. When a trade within the grid moves against the initial
MQL5 Expert Advisor Development (MT5) I need a professional MQL5 developer to create a custom Expert Advisor (EA) for MetaTrader 5 with high accuracy, low drawdown, and fast execution . 🔹 Strategy Requirements: Timeframe: Scalping-friendly (M1 / M5) Indicators Used: EMA 9 EMA 12 EMA 21 VWAP (as a trend filter) RSI (for trade confirmation) 🔹 Trade Logic: Buy and Sell entries based on EMA crossover + VWAP direction

Информация о проекте

Бюджет
100 - 200 USD
Сроки выполнения
до 5 дн.