Range Breakout EA in MQL5 according to spec

Specifiche

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


Con risposta

1
Sviluppatore 1
Valutazioni
(274)
Progetti
346
29%
Arbitraggio
36
28% / 64%
In ritardo
10
3%
Caricato
2
Sviluppatore 2
Valutazioni
(111)
Progetti
182
25%
Arbitraggio
24
17% / 75%
In ritardo
16
9%
Gratuito
3
Sviluppatore 3
Valutazioni
(22)
Progetti
21
10%
Arbitraggio
4
25% / 75%
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(160)
Progetti
207
61%
Arbitraggio
10
80% / 0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
5
Sviluppatore 5
Valutazioni
(329)
Progetti
515
19%
Arbitraggio
35
46% / 31%
In ritardo
34
7%
In elaborazione
6
Sviluppatore 6
Valutazioni
(2)
Progetti
3
33%
Arbitraggio
3
33% / 33%
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(2343)
Progetti
2948
63%
Arbitraggio
124
44% / 26%
In ritardo
429
15%
In elaborazione
8
Sviluppatore 8
Valutazioni
(33)
Progetti
35
20%
Arbitraggio
5
40% / 40%
In ritardo
0
Gratuito
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(321)
Progetti
326
71%
Arbitraggio
2
100% / 0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
10
Sviluppatore 10
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
(6)
Progetti
7
0%
Arbitraggio
2
0% / 100%
In ritardo
0
In elaborazione
12
Sviluppatore 12
Valutazioni
(613)
Progetti
716
33%
Arbitraggio
46
48% / 41%
In ritardo
14
2%
Caricato
13
Sviluppatore 13
Valutazioni
(45)
Progetti
46
24%
Arbitraggio
34
9% / 85%
In ritardo
10
22%
Gratuito
14
Sviluppatore 14
Valutazioni
Progetti
0
0%
Arbitraggio
1
0% / 0%
In ritardo
0
In elaborazione
Pubblicati: 2 codici
15
Sviluppatore 15
Valutazioni
(434)
Progetti
640
53%
Arbitraggio
34
62% / 21%
In ritardo
6
1%
In elaborazione
16
Sviluppatore 16
Valutazioni
(5)
Progetti
8
13%
Arbitraggio
3
0% / 33%
In ritardo
2
25%
Gratuito
Pubblicati: 1 codice
17
Sviluppatore 17
Valutazioni
(366)
Progetti
447
55%
Arbitraggio
23
57% / 17%
In ritardo
30
7%
Caricato
18
Sviluppatore 18
Valutazioni
(59)
Progetti
92
42%
Arbitraggio
4
0% / 100%
In ritardo
3
3%
In elaborazione
19
Sviluppatore 19
Valutazioni
(162)
Progetti
289
35%
Arbitraggio
18
22% / 61%
In ritardo
43
15%
Gratuito
20
Sviluppatore 20
Valutazioni
(8)
Progetti
9
56%
Arbitraggio
0
In ritardo
0
Gratuito
21
Sviluppatore 21
Valutazioni
(618)
Progetti
1429
59%
Arbitraggio
31
81% / 0%
In ritardo
10
1%
Gratuito
22
Sviluppatore 22
Valutazioni
(493)
Progetti
1022
58%
Arbitraggio
30
27% / 23%
In ritardo
133
13%
In elaborazione
23
Sviluppatore 23
Valutazioni
(322)
Progetti
499
67%
Arbitraggio
5
40% / 0%
In ritardo
4
1%
Gratuito
Pubblicati: 8 codici
24
Sviluppatore 24
Valutazioni
(2674)
Progetti
3412
68%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
In elaborazione
Pubblicati: 1 codice
25
Sviluppatore 25
Valutazioni
(513)
Progetti
552
53%
Arbitraggio
13
69% / 15%
In ritardo
3
1%
Gratuito
26
Sviluppatore 26
Valutazioni
(574)
Progetti
945
47%
Arbitraggio
309
58% / 27%
In ritardo
125
13%
Gratuito
Ordini simili
Hi, I Wanne have a trading robot that give me signals for short buy and sell. And only for all currency in forex trading and also can use it on mt5
I will pay 2500 to 10000 USD (negotiable) for one MT5 Expert Advisor, built properly. One robot done right, not a batch of cheap jobs. I have a strategy I believe in and a rough draft robot I built myself. The logic is there. The execution is not. That last part is outside my expertise, which is why I am hiring instead of continuing on my own. I am open to feedback on the strategy itself. If you see something in it
I Have an existing Mql5 Expert advisor (source code), I want a professional programmer to help me Modify the EA... so that it can stop taking new trades once it Gets to a Pacific Lots Size or Floating loss
I Have an existing Mql5 Expert advisor (source code), I want a professional programmer to help me Modify the EA... so that it can stop taking new trades once it Gets to a Pacific Lots Size or Floating loss
Hi, can you define entry conditions based on 100 or 200 trades? If you need more history, i can give you more trades. It is EURUSD with great results! If you can do it, contact me
Wise Legend 30 - 500 USD
I want this robot to alert me on a good entry point on the trading flat form ether to buy or to sell. And also alert me when to close the market. And alert me on market continuations
I have an existing MT5 Expert Advisor with the original MQ5 source code. I need an experienced MQL5 developer to review, debug and professionally improve the existing EA, not build an unrelated EA from scratch. The EA is mainly for XAUUSD and already contains entry signals, EMA filters, automatic lot sizing, basket profit management, spread/margin protection, news filtering and recovery logic. The main problem is the
I buy EA for USDEUR or XAUUSD for FTMO with proven backtest. Send me images with backtest reports where daily max dd is 1% on 200k account. I can buy several eas if you have them with proofs. Need images of backtesting for 5 years
I am looking for a programmer that can develop an MT4 indicator that shows COT DATA For Forex, indices and and metals. The indicator must be an oscillator or any other form that would work well in that format. It doesn't need to show all pairs at once, it can show only for current chart. Let's talk
Cerco uno sviluppatore MQL5 esperto per lavorare su un Expert Advisor (EA) XAUUSD per MetaTrader 5 già esistente , versione attuale XAU_V59.mq5 . L'obiettivo è modificare, correggere e sviluppare il codice esistente senza stravolgere la logica già presente , mantenendo le regole ei parametri già definiti, salvo le modifiche espressamente richieste. REQUISITI FONDAMENTALI Il codice deve essere scritto in MQL5 nativo e

Informazioni sul progetto

Budget
100 - 200 USD
Scadenze
a 5 giorno(i)