Expert Advisor that closes open positions on the chart if average profit in pips/points on all open positions is achieved

MQL4 专家 脚本

指定

I am looking for an expert advisor that manages open positions on my MT4 platform (Broker Details: FXCM; 5 Digits account; 30:1 leverage; Instruments: FX & CFDs) that are manually openend.

Logic: If average profit from all open positions in FX-Pair/CFD-contract is more than X-amount in pips/points, then close x-% of all open positions

Example: 

1.    If the average profit from all open positions in EURUSD is:

a.    more than 10 pips/points, then close 33% of all open positions

b.    more than 20 pips/points, then close 33% of all open positions

c.    more than 30 pips/points, then close 33% of all open positions

2.    If there are for example 5 positions open at the moment the first profit target is reached, the EA should close 2 positions (so round up because it is not possible to close 1,66 (5*33%) positions). If the second profit target is reached (and there were no new positions created in the meantime) the EA should close 1 position ((5-2)*33% = 1)

3.    While the EA is running in the background, the programm always has to monitor the change in open positions. So in case new positions are manually openend or closed the EA has to recalculate its next operations.

a.    Example from above: If the Second profit target was reached and there were new positions entered in the meantime, the EA should start with the initial configuation, so that if the „new“ average profit from all open positions in EURUSD is:

                                       i.    more than 10 pips/points, then close 33% of all open positions

                                      ii.    more than 20 pips/points, then close 33% of all open positions

                                    iii.    more than 30 pips/points, then close 33% of all open positions

4.    The EA should either use the FIFO (First in First out) or LIFO (Last in First out) principle, when closing positions

5.    I would like to enter several closing instructions; i.e.:

a.    1) If the average profit then…

b.    2) If the average profit then…

c.    3) If the average profit…

d.   

ð  If there needs to be a limit, than I would prefer 3 different closing instructions

6.    Under some circumstances the EA also needs to be able to work with magic numbers, so that it only closes positions that were assigned a certain magic number (on/off function).


反馈

1
开发者 1
等级
(52)
项目
133
44%
仲裁
14
50% / 29%
逾期
55
41%
空闲
2
开发者 2
等级
(885)
项目
1410
67%
仲裁
123
32% / 41%
逾期
218
15%
空闲
发布者: 1 代码
3
开发者 3
等级
(84)
项目
149
31%
仲裁
32
34% / 41%
逾期
43
29%
空闲
4
开发者 4
等级
(1235)
项目
2820
80%
仲裁
156
22% / 43%
逾期
487
17%
空闲
5
开发者 5
等级
(206)
项目
333
35%
仲裁
66
12% / 58%
逾期
87
26%
空闲
6
开发者 6
等级
(221)
项目
369
66%
仲裁
10
50% / 0%
逾期
46
12%
空闲
7
开发者 7
等级
(33)
项目
49
12%
仲裁
16
0% / 88%
逾期
10
20%
空闲
8
开发者 8
等级
(629)
项目
849
47%
仲裁
29
38% / 14%
逾期
63
7%
工作中
9
开发者 9
等级
(52)
项目
89
25%
仲裁
8
75% / 13%
逾期
44
49%
已载入
10
开发者 10
等级
(33)
项目
35
40%
仲裁
11
9% / 91%
逾期
4
11%
空闲
发布者: 4 代码
11
开发者 11
等级
(136)
项目
196
43%
仲裁
17
29% / 59%
逾期
28
14%
空闲
12
开发者 12
等级
(59)
项目
182
55%
仲裁
31
45% / 16%
逾期
103
57%
空闲
13
开发者 13
等级
(195)
项目
395
28%
仲裁
155
20% / 52%
逾期
112
28%
空闲
14
开发者 14
等级
(493)
项目
1022
58%
仲裁
30
27% / 23%
逾期
133
13%
工作中
15
开发者 15
等级
(2643)
项目
3359
68%
仲裁
77
48% / 14%
逾期
342
10%
工作中
发布者: 1 代码
16
开发者 16
等级
(43)
项目
74
50%
仲裁
5
0% / 60%
逾期
19
26%
空闲
17
开发者 17
等级
(65)
项目
87
39%
仲裁
3
0% / 33%
逾期
29
33%
空闲
18
开发者 18
等级
(574)
项目
945
47%
仲裁
309
58% / 27%
逾期
125
13%
空闲
19
开发者 19
等级
(69)
项目
146
34%
仲裁
13
8% / 62%
逾期
26
18%
空闲
发布者: 6 代码
20
开发者 20
等级
(1)
项目
1
0%
仲裁
1
0% / 100%
逾期
0
空闲

项目信息

预算
50 - 150 USD