Code to count lot size of the same currency across orders on both buy and sell

MQL4 Asesores Expertos Sripts

Trabajo finalizado

Plazo de ejecución 3 días
Comentario del Ejecutor
Excellent client. Was helpful with testing and not afraid to ask questions.

Tarea técnica

I need a developer with very good English skills to provide me the code for a function that I want to insert into my own code and which should do the following:

-          Count how many open orders a currency (or an index, etc) is involved in, separately on buy and sell.

-          Count the total lot size on buy and the total lot size on sell that the currency (or index) is involved in.


For example, if I have the following trades open:

2 lots of SELL GBPUSD

0.5 lot of SELL EURGBP

0.5 lot of BUY EURUSD

 

Then the results provided by the function will be:

Total number of open orders BUY on GBP: 1

Total lot size BUY on GBP: 0.5

Total number of open orders SELL on GBP: 1

Total lot size SELL on GBP: 2

Net lot size on GBP (BUY-SELL): -1.5


The function will return the same type of results for EUR, USD and all other currencies, indices, etc that are involved in open orders.

Important: you have to be careful to identify when the currency is the first or the second in the currency pair in order to get the result right. For example, a SELL order on EURGBP counts as a SELL on EUR, but as a BUY on GBP.

The code should also work for symbols composed of only one element, like US30.

Exception: I need an exception to be introduced in the case of instruments XTIUSD and XAUUSD, in the sense that in these cases the function will NOT add these to the count of number of orders and size of lots on USD, BUT it will add them to the count of the number of orders and the size of lots on XTI and XAU respectively.

Use of the function:

I should be able to call this function in the main program something like this: get_lot_count(Symbol), where symbol can be GBPUSD, XTIUSD, US30, etc. When called, the function will calculate and provide (in separate variables) all the information mentioned above in relation to the instrument(s) present in the symbol, regardless of whether there are 2 currencies  in the Symbol (like in EURUSD, in which case the information will be, of course, separate for EUR and USD) or a stand-alone instrument in the symbol (like in US30).

I am flexible to suggestions on how to best organise the information.

Note: when applying for this job please let me know if you have experience in doing something similar or other information that would help me understand that you actually looked carefully at the specs and that you are not just sending an “automated” application.


Han respondido

1
Desarrollador 1
Evaluación
(19)
Proyectos
35
26%
Arbitraje
10
30% / 70%
Caducado
5
14%
Libre
2
Desarrollador 2
Evaluación
(390)
Proyectos
416
30%
Arbitraje
74
19% / 72%
Caducado
52
13%
Trabaja
3
Desarrollador 3
Evaluación
(50)
Proyectos
74
27%
Arbitraje
12
58% / 17%
Caducado
14
19%
Libre
4
Desarrollador 4
Evaluación
(130)
Proyectos
184
32%
Arbitraje
18
28% / 67%
Caducado
27
15%
Libre
Ha publicado: 1 ejemplo
5
Desarrollador 5
Evaluación
(88)
Proyectos
143
39%
Arbitraje
21
19% / 48%
Caducado
30
21%
Libre
6
Desarrollador 6
Evaluación
(36)
Proyectos
50
28%
Arbitraje
2
0% / 100%
Caducado
6
12%
Libre
7
Desarrollador 7
Evaluación
(27)
Proyectos
43
7%
Arbitraje
18
6% / 78%
Caducado
26
60%
Libre
8
Desarrollador 8
Evaluación
(84)
Proyectos
149
31%
Arbitraje
32
34% / 41%
Caducado
43
29%
Libre
9
Desarrollador 9
Evaluación
(4)
Proyectos
4
25%
Arbitraje
1
0% / 0%
Caducado
0
Libre
Ha publicado: 3 ejemplos
10
Desarrollador 10
Evaluación
(64)
Proyectos
144
46%
Arbitraje
19
42% / 16%
Caducado
32
22%
Trabaja

Información sobre el proyecto

Presupuesto
30 - 50 USD
Plazo límite de ejecución
de 2 a 3 día(s)