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

MQL4 Esperti Script

Lavoro terminato

Tempo di esecuzione 3 giorni
Feedback del dipendente
Excellent client. Was helpful with testing and not afraid to ask questions.

Specifiche

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.


Con risposta

1
Sviluppatore 1
Valutazioni
(19)
Progetti
35
26%
Arbitraggio
10
30% / 70%
In ritardo
5
14%
Gratuito
2
Sviluppatore 2
Valutazioni
(390)
Progetti
416
30%
Arbitraggio
74
19% / 72%
In ritardo
52
13%
In elaborazione
3
Sviluppatore 3
Valutazioni
(50)
Progetti
74
27%
Arbitraggio
12
58% / 17%
In ritardo
14
19%
Gratuito
4
Sviluppatore 4
Valutazioni
(130)
Progetti
184
32%
Arbitraggio
18
28% / 67%
In ritardo
27
15%
Gratuito
Pubblicati: 1 codice
5
Sviluppatore 5
Valutazioni
(88)
Progetti
143
39%
Arbitraggio
21
19% / 48%
In ritardo
30
21%
Gratuito
6
Sviluppatore 6
Valutazioni
(36)
Progetti
50
28%
Arbitraggio
2
0% / 100%
In ritardo
6
12%
Gratuito
7
Sviluppatore 7
Valutazioni
(27)
Progetti
43
7%
Arbitraggio
18
6% / 78%
In ritardo
26
60%
Gratuito
8
Sviluppatore 8
Valutazioni
(84)
Progetti
149
31%
Arbitraggio
32
34% / 41%
In ritardo
43
29%
Gratuito
9
Sviluppatore 9
Valutazioni
(4)
Progetti
4
25%
Arbitraggio
1
0% / 0%
In ritardo
0
Gratuito
Pubblicati: 3 codici
10
Sviluppatore 10
Valutazioni
(64)
Progetti
144
46%
Arbitraggio
19
42% / 16%
In ritardo
32
22%
In elaborazione

Informazioni sul progetto

Budget
30 - 50 USD
Scadenze
da 2 a 3 giorno(i)