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

MQL4 Experts Scripts

Spécifications

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).


Répondu

1
Développeur 1
Évaluation
(52)
Projets
133
44%
Arbitrage
14
50% / 29%
En retard
55
41%
Gratuit
2
Développeur 2
Évaluation
(885)
Projets
1410
67%
Arbitrage
123
32% / 41%
En retard
218
15%
Gratuit
Publié : 1 code
3
Développeur 3
Évaluation
(84)
Projets
149
31%
Arbitrage
32
34% / 41%
En retard
43
29%
Gratuit
4
Développeur 4
Évaluation
(1235)
Projets
2820
80%
Arbitrage
156
22% / 43%
En retard
487
17%
Gratuit
5
Développeur 5
Évaluation
(206)
Projets
333
35%
Arbitrage
66
12% / 58%
En retard
87
26%
Gratuit
6
Développeur 6
Évaluation
(221)
Projets
369
66%
Arbitrage
10
50% / 0%
En retard
46
12%
Gratuit
7
Développeur 7
Évaluation
(33)
Projets
49
12%
Arbitrage
16
0% / 88%
En retard
10
20%
Gratuit
8
Développeur 8
Évaluation
(638)
Projets
861
48%
Arbitrage
29
38% / 17%
En retard
63
7%
Travail
9
Développeur 9
Évaluation
(55)
Projets
92
24%
Arbitrage
8
75% / 13%
En retard
44
48%
Gratuit
10
Développeur 10
Évaluation
(33)
Projets
35
40%
Arbitrage
11
9% / 91%
En retard
4
11%
Gratuit
Publié : 4 codes
11
Développeur 11
Évaluation
(136)
Projets
196
43%
Arbitrage
17
29% / 59%
En retard
28
14%
Gratuit
12
Développeur 12
Évaluation
(59)
Projets
182
55%
Arbitrage
31
45% / 16%
En retard
103
57%
Gratuit
13
Développeur 13
Évaluation
(195)
Projets
395
28%
Arbitrage
155
20% / 52%
En retard
112
28%
Gratuit
14
Développeur 14
Évaluation
(493)
Projets
1022
58%
Arbitrage
30
27% / 23%
En retard
133
13%
Travail
15
Développeur 15
Évaluation
(2661)
Projets
3382
68%
Arbitrage
77
48% / 14%
En retard
342
10%
Gratuit
Publié : 1 code
16
Développeur 16
Évaluation
(43)
Projets
74
50%
Arbitrage
5
0% / 60%
En retard
19
26%
Gratuit
17
Développeur 17
Évaluation
(65)
Projets
87
39%
Arbitrage
3
0% / 33%
En retard
29
33%
Gratuit
18
Développeur 18
Évaluation
(574)
Projets
945
47%
Arbitrage
309
58% / 27%
En retard
125
13%
Gratuit
19
Développeur 19
Évaluation
(69)
Projets
146
34%
Arbitrage
13
8% / 62%
En retard
26
18%
Gratuit
Publié : 6 codes
20
Développeur 20
Évaluation
(1)
Projets
1
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit

Informations sur le projet

Budget
50 - 150 USD