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

MQL4 Uzmanlar Komut dosyaları

Şartname

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


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(52)
Projeler
133
44%
Arabuluculuk
14
50% / 29%
Süresi dolmuş
55
41%
Serbest
2
Geliştirici 2
Derecelendirme
(885)
Projeler
1410
67%
Arabuluculuk
123
32% / 41%
Süresi dolmuş
218
15%
Serbest
Yayınlandı: 1 kod
3
Geliştirici 3
Derecelendirme
(84)
Projeler
149
31%
Arabuluculuk
32
34% / 41%
Süresi dolmuş
43
29%
Serbest
4
Geliştirici 4
Derecelendirme
(1235)
Projeler
2820
80%
Arabuluculuk
156
22% / 43%
Süresi dolmuş
487
17%
Serbest
5
Geliştirici 5
Derecelendirme
(206)
Projeler
333
35%
Arabuluculuk
66
12% / 58%
Süresi dolmuş
87
26%
Serbest
6
Geliştirici 6
Derecelendirme
(221)
Projeler
369
66%
Arabuluculuk
10
50% / 0%
Süresi dolmuş
46
12%
Serbest
7
Geliştirici 7
Derecelendirme
(33)
Projeler
49
12%
Arabuluculuk
16
0% / 88%
Süresi dolmuş
10
20%
Serbest
8
Geliştirici 8
Derecelendirme
(638)
Projeler
861
48%
Arabuluculuk
29
38% / 17%
Süresi dolmuş
63
7%
Çalışıyor
9
Geliştirici 9
Derecelendirme
(55)
Projeler
92
24%
Arabuluculuk
8
75% / 13%
Süresi dolmuş
44
48%
Serbest
10
Geliştirici 10
Derecelendirme
(33)
Projeler
35
40%
Arabuluculuk
11
9% / 91%
Süresi dolmuş
4
11%
Serbest
Yayınlandı: 4 kod
11
Geliştirici 11
Derecelendirme
(136)
Projeler
196
43%
Arabuluculuk
17
29% / 59%
Süresi dolmuş
28
14%
Serbest
12
Geliştirici 12
Derecelendirme
(59)
Projeler
182
55%
Arabuluculuk
31
45% / 16%
Süresi dolmuş
103
57%
Serbest
13
Geliştirici 13
Derecelendirme
(195)
Projeler
395
28%
Arabuluculuk
155
20% / 52%
Süresi dolmuş
112
28%
Serbest
14
Geliştirici 14
Derecelendirme
(493)
Projeler
1022
58%
Arabuluculuk
30
27% / 23%
Süresi dolmuş
133
13%
Çalışıyor
15
Geliştirici 15
Derecelendirme
(2662)
Projeler
3383
68%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
342
10%
Serbest
Yayınlandı: 1 kod
16
Geliştirici 16
Derecelendirme
(43)
Projeler
74
50%
Arabuluculuk
5
0% / 60%
Süresi dolmuş
19
26%
Serbest
17
Geliştirici 17
Derecelendirme
(65)
Projeler
87
39%
Arabuluculuk
3
0% / 33%
Süresi dolmuş
29
33%
Serbest
18
Geliştirici 18
Derecelendirme
(574)
Projeler
945
47%
Arabuluculuk
309
58% / 27%
Süresi dolmuş
125
13%
Serbest
19
Geliştirici 19
Derecelendirme
(69)
Projeler
146
34%
Arabuluculuk
13
8% / 62%
Süresi dolmuş
26
18%
Serbest
Yayınlandı: 6 kod
20
Geliştirici 20
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest

Proje bilgisi

Bütçe
50 - 150 USD