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
Оценка
(263)
Проекты
329
29%
Арбитраж
35
26% / 63%
Просрочено
10
3%
Работает
2
Разработчик 2
Оценка
(108)
Проекты
176
25%
Арбитраж
24
13% / 75%
Просрочено
16
9%
Работает
3
Разработчик 3
Оценка
(22)
Проекты
21
10%
Арбитраж
4
25% / 75%
Просрочено
0
Свободен
4
Разработчик 4
Оценка
(160)
Проекты
202
60%
Арбитраж
10
80% / 0%
Просрочено
0
Работает
Опубликовал: 1 пример
5
Разработчик 5
Оценка
(328)
Проекты
513
19%
Арбитраж
34
44% / 32%
Просрочено
34
7%
Загружен
6
Разработчик 6
Оценка
(2)
Проекты
3
33%
Арбитраж
3
33% / 33%
Просрочено
0
Свободен
7
Разработчик 7
Оценка
(2330)
Проекты
2934
63%
Арбитраж
124
44% / 26%
Просрочено
429
15%
Свободен
8
Разработчик 8
Оценка
(33)
Проекты
35
20%
Арбитраж
5
40% / 40%
Просрочено
0
Свободен
Опубликовал: 1 пример
9
Разработчик 9
Оценка
(316)
Проекты
321
70%
Арбитраж
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
Оценка
(602)
Проекты
696
33%
Арбитраж
43
47% / 44%
Просрочено
12
2%
Занят
13
Разработчик 13
Оценка
(45)
Проекты
46
24%
Арбитраж
34
9% / 85%
Просрочено
10
22%
Свободен
14
Разработчик 14
Оценка
Проекты
0
0%
Арбитраж
1
0% / 0%
Просрочено
0
Работает
Опубликовал: 2 примера
15
Разработчик 15
Оценка
(434)
Проекты
638
53%
Арбитраж
32
59% / 22%
Просрочено
6
1%
Работает
16
Разработчик 16
Оценка
(5)
Проекты
8
13%
Арбитраж
3
0% / 33%
Просрочено
2
25%
Свободен
Опубликовал: 1 пример
17
Разработчик 17
Оценка
(365)
Проекты
439
54%
Арбитраж
22
50% / 14%
Просрочено
30
7%
Загружен
18
Разработчик 18
Оценка
(58)
Проекты
90
43%
Арбитраж
4
0% / 100%
Просрочено
3
3%
Работает
19
Разработчик 19
Оценка
(162)
Проекты
289
35%
Арбитраж
18
22% / 61%
Просрочено
43
15%
Свободен
20
Разработчик 20
Оценка
(8)
Проекты
9
56%
Арбитраж
0
Просрочено
0
Свободен
21
Разработчик 21
Оценка
(618)
Проекты
1429
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
Оценка
(2671)
Проекты
3404
68%
Арбитраж
77
48% / 14%
Просрочено
342
10%
Свободен
Опубликовал: 1 пример
25
Разработчик 25
Оценка
(513)
Проекты
552
53%
Арбитраж
13
69% / 15%
Просрочено
3
1%
Свободен
26
Разработчик 26
Оценка
(574)
Проекты
945
47%
Арбитраж
309
58% / 27%
Просрочено
125
13%
Свободен
Похожие заказы
I am not looking for someone to simply code an MT5 Expert Advisor. I already know how to create EAs and can generate simple strategies myself. What I am looking for is someone with strong quantitative research and backtesting experience who can find and validate a robust trading strategy. Objective Your job is to research and test different entry models to find one that has a real statistical edge. I do not care
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
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
I am currently using the attached Arbitrage MACD indicator. However, there are no signal alerts associated with this indicator. I would like to receive notifications on my android device the bar after a blue long arrow appears and the bar after a red short arrow appears. This is the current code: //+------------+-----------------------------------------------------+ //| v.22.04.07 | ArrZZx2.mq4 |
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; }
مطلوب موشر مع ربطه علي بوت تداول قوي جدا مختبر ومجرب مع التاكيد علي نسبه النجاح يتم انشاءه علي جميع الموشرات في الفوركس الذهب والبتكوين والus100 مع شرح للستراتيجية ونتايج اختيار اذا كان مجرب
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 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

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

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