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

MQL4 Esperti Script

Specifiche

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


Con risposta

1
Sviluppatore 1
Valutazioni
(52)
Progetti
133
44%
Arbitraggio
14
50% / 29%
In ritardo
55
41%
Gratuito
2
Sviluppatore 2
Valutazioni
(879)
Progetti
1393
67%
Arbitraggio
117
32% / 42%
In ritardo
215
15%
In elaborazione
3
Sviluppatore 3
Valutazioni
(84)
Progetti
149
31%
Arbitraggio
32
34% / 41%
In ritardo
43
29%
Gratuito
4
Sviluppatore 4
Valutazioni
(1235)
Progetti
2820
80%
Arbitraggio
156
22% / 43%
In ritardo
488
17%
Gratuito
5
Sviluppatore 5
Valutazioni
(197)
Progetti
320
35%
Arbitraggio
64
13% / 56%
In ritardo
83
26%
Gratuito
6
Sviluppatore 6
Valutazioni
(221)
Progetti
369
66%
Arbitraggio
10
50% / 0%
In ritardo
46
12%
Gratuito
7
Sviluppatore 7
Valutazioni
(33)
Progetti
49
12%
Arbitraggio
16
0% / 88%
In ritardo
10
20%
Gratuito
8
Sviluppatore 8
Valutazioni
(564)
Progetti
779
46%
Arbitraggio
23
39% / 13%
In ritardo
63
8%
In elaborazione
9
Sviluppatore 9
Valutazioni
(48)
Progetti
80
28%
Arbitraggio
8
75% / 13%
In ritardo
41
51%
Gratuito
10
Sviluppatore 10
Valutazioni
(33)
Progetti
35
40%
Arbitraggio
11
9% / 91%
In ritardo
4
11%
Gratuito
11
Sviluppatore 11
Valutazioni
(135)
Progetti
193
42%
Arbitraggio
17
29% / 59%
In ritardo
28
15%
Gratuito
12
Sviluppatore 12
Valutazioni
(59)
Progetti
182
55%
Arbitraggio
31
45% / 16%
In ritardo
103
57%
Gratuito
13
Sviluppatore 13
Valutazioni
(195)
Progetti
395
28%
Arbitraggio
155
20% / 52%
In ritardo
112
28%
Gratuito
14
Sviluppatore 14
Valutazioni
(491)
Progetti
1017
58%
Arbitraggio
29
28% / 24%
In ritardo
132
13%
Gratuito
15
Sviluppatore 15
Valutazioni
(2442)
Progetti
3079
66%
Arbitraggio
77
48% / 14%
In ritardo
340
11%
In elaborazione
16
Sviluppatore 16
Valutazioni
(43)
Progetti
72
49%
Arbitraggio
4
0% / 50%
In ritardo
19
26%
Gratuito
17
Sviluppatore 17
Valutazioni
(65)
Progetti
87
39%
Arbitraggio
3
0% / 33%
In ritardo
29
33%
Gratuito
18
Sviluppatore 18
Valutazioni
(564)
Progetti
933
47%
Arbitraggio
302
59% / 25%
In ritardo
125
13%
Caricato
19
Sviluppatore 19
Valutazioni
(66)
Progetti
143
34%
Arbitraggio
10
10% / 60%
In ritardo
26
18%
Gratuito
20
Sviluppatore 20
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito

Informazioni sul progetto

Budget
50 - 150 USD
IVA (19%): 9.5 - 28.5 USD
Totale: 59.5 - 178.5 USD
Per lo sviluppatore
45 - 135 USD