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
等级
(274)
项目
346
29%
仲裁
36
28% / 64%
逾期
10
3%
已载入
2
开发者 2
等级
(111)
项目
182
25%
仲裁
24
17% / 75%
逾期
16
9%
空闲
3
开发者 3
等级
(22)
项目
21
10%
仲裁
4
25% / 75%
逾期
0
空闲
4
开发者 4
等级
(160)
项目
207
61%
仲裁
10
80% / 0%
逾期
0
空闲
发布者: 1 代码
5
开发者 5
等级
(329)
项目
515
19%
仲裁
35
46% / 31%
逾期
34
7%
工作中
6
开发者 6
等级
(2)
项目
3
33%
仲裁
3
33% / 33%
逾期
0
空闲
7
开发者 7
等级
(2343)
项目
2948
63%
仲裁
124
44% / 26%
逾期
429
15%
工作中
8
开发者 8
等级
(33)
项目
35
20%
仲裁
5
40% / 40%
逾期
0
空闲
发布者: 1 代码
9
开发者 9
等级
(321)
项目
326
71%
仲裁
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
等级
(613)
项目
716
33%
仲裁
46
48% / 41%
逾期
14
2%
已载入
13
开发者 13
等级
(45)
项目
46
24%
仲裁
34
9% / 85%
逾期
10
22%
空闲
14
开发者 14
等级
项目
0
0%
仲裁
1
0% / 0%
逾期
0
工作中
发布者: 2 代码
15
开发者 15
等级
(434)
项目
640
53%
仲裁
34
62% / 21%
逾期
6
1%
工作中
16
开发者 16
等级
(5)
项目
8
13%
仲裁
3
0% / 33%
逾期
2
25%
空闲
发布者: 1 代码
17
开发者 17
等级
(366)
项目
447
55%
仲裁
23
57% / 17%
逾期
30
7%
已载入
18
开发者 18
等级
(59)
项目
92
42%
仲裁
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
等级
(2674)
项目
3412
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%
空闲
相似订单
*JOB TITLE:* `MQL5 EA: 8-Indicator Confluence Bot for XAUUSD, US30, NAS100, DE40 + News + DD Protection` *BUDGET:* $300 - $400 *TIMELINE:* 10 - 14 days *PLATFORM:* MetaTrader 4 & 5 *ATTACHMENTS:* `Indicators.zip` = 10 indicators + 5 screenshots with all settings --- *1. CORE TRADING LOGIC - ON CANDLE CLOSE ONLY* *BUY when ALL conditions are TRUE:* 1. Price > 200 SMA 2. `Reversal Indicator` = UP arrow/dot 3
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
the bot will be used for xauusd scalp trading , want the bor follow the trading indicator will SL and open another opposite order where i can customize the SL margin and risk management
​1. General Overview: I am looking for an experienced developer to build (or debug/optimize) an MQL5 Expert Advisor. The EA will primarily trade Gold (XAU/USD) and US Indices (US30, US100). ​2. Platform & Broker Requirements: ​Platform: MetaTrader 5 (MQL5) ​Broker: Must be fully compatible with XM Broker execution. ​Account Types: Must support both Standard and Micro lot sizing seamlessly. ​3. Technical & Skill
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
take your time better make it for days and have good bot than never benefits both of us. Make the bot have zero errors and backtest it for a 2 year period
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

项目信息

预算
100 - 200 USD
截止日期
 5 天