Range Breakout EA in MQL5 according to spec

Spécifications

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


Répondu

1
Développeur 1
Évaluation
(258)
Projets
321
30%
Arbitrage
34
26% / 65%
En retard
10
3%
Gratuit
2
Développeur 2
Évaluation
(106)
Projets
173
25%
Arbitrage
23
9% / 78%
En retard
16
9%
Travail
3
Développeur 3
Évaluation
(22)
Projets
21
10%
Arbitrage
4
25% / 75%
En retard
0
Gratuit
4
Développeur 4
Évaluation
(156)
Projets
197
59%
Arbitrage
10
80% / 0%
En retard
0
Travail
Publié : 1 code
5
Développeur 5
Évaluation
(328)
Projets
512
19%
Arbitrage
33
45% / 30%
En retard
34
7%
Occupé
6
Développeur 6
Évaluation
(2)
Projets
3
33%
Arbitrage
3
33% / 33%
En retard
0
Gratuit
7
Développeur 7
Évaluation
(2322)
Projets
2925
63%
Arbitrage
123
45% / 25%
En retard
429
15%
Gratuit
8
Développeur 8
Évaluation
(33)
Projets
35
20%
Arbitrage
5
40% / 40%
En retard
0
Gratuit
Publié : 1 code
9
Développeur 9
Évaluation
(310)
Projets
315
70%
Arbitrage
2
100% / 0%
En retard
0
Gratuit
Publié : 1 code
10
Développeur 10
Évaluation
(1)
Projets
1
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
11
Développeur 11
Évaluation
(6)
Projets
7
0%
Arbitrage
2
0% / 100%
En retard
0
Travail
12
Développeur 12
Évaluation
(572)
Projets
664
32%
Arbitrage
42
45% / 45%
En retard
12
2%
Travail
13
Développeur 13
Évaluation
(45)
Projets
46
24%
Arbitrage
34
9% / 85%
En retard
10
22%
Gratuit
14
Développeur 14
Évaluation
Projets
0
0%
Arbitrage
1
0% / 0%
En retard
0
Travail
Publié : 2 codes
15
Développeur 15
Évaluation
(434)
Projets
635
54%
Arbitrage
32
56% / 22%
En retard
6
1%
Travail
16
Développeur 16
Évaluation
(5)
Projets
8
13%
Arbitrage
3
0% / 33%
En retard
2
25%
Gratuit
Publié : 1 code
17
Développeur 17
Évaluation
(362)
Projets
435
54%
Arbitrage
21
52% / 14%
En retard
30
7%
Travail
18
Développeur 18
Évaluation
(58)
Projets
90
43%
Arbitrage
4
0% / 100%
En retard
3
3%
Travail
19
Développeur 19
Évaluation
(162)
Projets
289
35%
Arbitrage
18
22% / 61%
En retard
43
15%
Gratuit
20
Développeur 20
Évaluation
(8)
Projets
9
56%
Arbitrage
0
En retard
0
Gratuit
21
Développeur 21
Évaluation
(618)
Projets
1428
59%
Arbitrage
31
81% / 0%
En retard
10
1%
Gratuit
22
Développeur 22
Évaluation
(493)
Projets
1022
58%
Arbitrage
30
27% / 23%
En retard
133
13%
Travail
23
Développeur 23
Évaluation
(322)
Projets
499
67%
Arbitrage
5
40% / 0%
En retard
4
1%
Gratuit
Publié : 8 codes
24
Développeur 24
Évaluation
(2662)
Projets
3384
68%
Arbitrage
77
48% / 14%
En retard
342
10%
Travail
Publié : 1 code
25
Développeur 25
Évaluation
(511)
Projets
550
53%
Arbitrage
13
69% / 15%
En retard
3
1%
Gratuit
26
Développeur 26
Évaluation
(574)
Projets
945
47%
Arbitrage
309
58% / 27%
En retard
125
13%
Gratuit
Commandes similaires
Junior EA 30+ USD
1. EA for MT5, hedging allowed. 2. Entry: 50 EMA crosses 200 EMA on H1. Buy on bullish cross, sell on bearish. 3. SL: 100 pips, TP: 200 pips. No trailing stop. 4. Lot size: 0.01 fixed. Max 3 trades at once. 5. Trade only 08:00-18:00 GMT. No trades if spread > 20 points. 6. Inputs: EMA periods, SL, TP, lot size, start/end time
EliBoT 39+ USD
//+------------------------------------------------------------------+ //| TrendPullbackEA.mq5 | //| Simple Trend + Pullback Strategy EA (Beginner Friendly) | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; //------------------------------------------------------------------- // INPUT PARAMETERS
//+------------------------------------------------------------------+ //| BORGMAN SMC EA v8.7 - INSTITUTIONAL MERGE | //| Combines v8.5 risk architecture + v8.6 SMC engine | //+------------------------------------------------------------------+ #property strict #property version "8.70" #include <Trade/Trade.mqh> CTrade Trade; //---------------------- ENUMS ----------------------// enum ENUM_RR_MODE { RR_2R, // 1:2
I need an experienced MQL5 developer to build a semi automated trading signal system for Gold (XAUUSD) on MT5. The system is NOT a martingale or grid EA. The goal is to build a clean rule based signal engine that detects high probability setups based on predefined strategy rules and sends trading alerts with optional pending order logic. Main Requirements: 1. Signal Generation - Buy and Sell signals - Buy Limit - Buy
Mambo 30+ USD
I need a bot that can trade weltrade synthetic indices that can be consistently making profits if you have one for deriv its also fine a bot that executes and closes trades automat Will be ideal
MT5 Expert Advisor Specification: Asian Liquidity Sweep & M5 FVG Entry ​Project Overview ​Automated Expert Advisor for EUR/USD on MT5. The strategy maps structural liquidity (Fractal Swings) for entry triggers but targets absolute session extremes for Take Profit. It enters on the first opposite M5 Fair Value Gap (FVG) and features a dynamic, user-controlled risk engine. ​1. Timezone & News Filter Requirements ​The
I am looking for an experienced MQL4/MQL5 developer to build a custom MT4 indicator from scratch or cracking my ex4 file that i provide to you. I already have an existing indicator (EX4) which produces highly accurate buy/sell signals. I want a similar indicator developed based on its observable behavior and signal structure. my existing indicator is pc id protected so you have to do PC ID security bypass and source
I am looking for an experienced MQL5 developer to build a professional Expert Advisor with the following specs: TECHNICAL REQUIREMENTS: - Platform: MetaTrader 5 (MT5) - Pairs: GBPUSD and EURUSD - Broker suffix support (e.g. GBPUSD@, EURUSD@) - Primary timeframe: M5 -Higher timeframe bias: H1 and H4 (for trend direction only) - One chart setup — manages both pairs from one chart STRATEGY: - Price action based: BOS
OBJETIVO Criar um Expert Advisor MT5 profissional para XAUUSD focado em: Consistência Baixo drawdown Scalping profissional Proteção da conta Crescimento sustentável Compatibilidade com conta micro e prop firms NÃO utilizar: Martingale Grid Hedge agressivo Recovery system Multiplicação de lotes após perda --- ATIVO XAUUSD apenas --- TIMEFRAMES Timeframe principal M5 Confirmação tendência M15 Confirmação macro opcional
I need a very advanced and intelligent MT5 Expert Advisor coded in MQL5 for XAUUSD, based on ICT + CRT + Smart Money Concepts. The goal is not a simple robot, but a professional decision-making system with strong filters, risk control, and high-quality trade selection. The EA must include: 1. Multi-Timeframe Analysis - D1 / H4 / H1 bias - M15 / M5 entry confirmation - Bullish or bearish market structure - BOS, CHoCH

Informations sur le projet

Budget
100 - 200 USD
Délais
à 5 jour(s)