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

MQL4 Experts Scripts

Specification

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


Responded

1
Developer 1
Rating
(52)
Projects
133
44%
Arbitration
14
50% / 29%
Overdue
55
41%
Free
2
Developer 2
Rating
(879)
Projects
1392
67%
Arbitration
117
32% / 42%
Overdue
215
15%
Free
3
Developer 3
Rating
(84)
Projects
149
31%
Arbitration
32
34% / 41%
Overdue
43
29%
Free
4
Developer 4
Rating
(1235)
Projects
2820
80%
Arbitration
156
22% / 43%
Overdue
488
17%
Free
5
Developer 5
Rating
(196)
Projects
318
35%
Arbitration
64
13% / 56%
Overdue
82
26%
Free
6
Developer 6
Rating
(221)
Projects
369
66%
Arbitration
10
50% / 0%
Overdue
46
12%
Free
7
Developer 7
Rating
(33)
Projects
49
12%
Arbitration
16
0% / 88%
Overdue
10
20%
Free
8
Developer 8
Rating
(559)
Projects
770
46%
Arbitration
23
39% / 13%
Overdue
63
8%
Working
9
Developer 9
Rating
(48)
Projects
80
28%
Arbitration
8
75% / 13%
Overdue
41
51%
Free
10
Developer 10
Rating
(33)
Projects
35
40%
Arbitration
11
9% / 91%
Overdue
4
11%
Free
11
Developer 11
Rating
(135)
Projects
193
42%
Arbitration
17
29% / 59%
Overdue
28
15%
Free
12
Developer 12
Rating
(59)
Projects
182
55%
Arbitration
31
45% / 16%
Overdue
103
57%
Free
13
Developer 13
Rating
(195)
Projects
395
28%
Arbitration
155
20% / 52%
Overdue
112
28%
Free
14
Developer 14
Rating
(491)
Projects
1017
58%
Arbitration
29
28% / 24%
Overdue
132
13%
Free
15
Developer 15
Rating
(2434)
Projects
3065
66%
Arbitration
77
48% / 14%
Overdue
340
11%
Working
16
Developer 16
Rating
(43)
Projects
72
49%
Arbitration
4
0% / 50%
Overdue
19
26%
Free
17
Developer 17
Rating
(65)
Projects
87
39%
Arbitration
3
0% / 33%
Overdue
29
33%
Free
18
Developer 18
Rating
(563)
Projects
932
47%
Arbitration
302
59% / 25%
Overdue
124
13%
Busy
19
Developer 19
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Free
20
Developer 20
Rating
(1)
Projects
1
0%
Arbitration
1
0% / 100%
Overdue
0
Free
Similar orders
Looking for a skilled freelancer to create a simple indicator that displays key data directly on the chart during a backtest on MetaTrader 4. The indicator should show: - **Balance** - **Profit in $** - **Profit in %** I already have the sample in MT5 (.mq5 file), but I need it converted and optimized for MT4. This is a straightforward task with a quick turnaround time—just 2 hours. I'm offering $250 for this
Hi, I have a Compiled JForex strategy (.jfx file) I would like someone to convert it in to readable source code. Please let me know if you can do this task. Thank you
I want to make something automatic which EMA will automatically trade in my account. For this I want to make a simple robot I want to get this made automatically on a simple EMA
I need a professional who have the full knowledge in Ctrader and I want to add new idea for my ctrader https://ctrader.com/algos/indicators/show/3444/ Let me know if this is what you can do and the price to get it done. Thanks
I am looking for a skilled Thinkorswim script developer for a one-time project. Your task will be to combine 8 distinct Thinkorswim studies (I will provide the code for each) into one Lower Study. The final script should display histogram rows for the individual studies with a bubble color scheme of bright green, dark green, gray, dark red, and bright red
I need some who can develop my strategy and hand me over the source code... I will give you the specific area in the market i want to mark out and then set pending orders to execute once price move into the zone

Project information

Budget
50 - 150 USD
VAT (19%): 9.5 - 28.5 USD
Total: 59.5 - 178.5 USD
For the developer
45 - 135 USD