Select last 30 orders in history with magic number 999999 MQL4

MQL4 Experts Scripts

Trabalho concluído

Tempo de execução 3 minutos
Comentário do cliente
Compliments to Ivand for his work. His work was quick, accurate for a reasonable price. He also helped me with the running of the script. Would definitely recommend him as a EA programmer to others.

Termos de Referência

Hallo,

I want to select the last 30 orders form my EA with the magicnumber 999999  in MQL4. Currently my code is like this which doesnt account for the MagicNumber:

OrderSelect(OrdersHistoryTotal()-30,SELECT_BY_POS,MODE_HISTORY);  
   double G30 = OrderProfit();                                       if(G30 > 0) W ++;  
   if(G30 == 0) G30 = 0.0001; 
   if(G30 > 0) Wins = Wins + G30; 
   if(G30 < 0) Loss = Loss + G30;
   OrderSelect(OrdersHistoryTotal()-29,SELECT_BY_POS,MODE_HISTORY);  
   double G29 = OrderProfit();                                       if(G29 > 0) W ++; 
   if(G29 == 0) G29 = 0.0001; 
   if(G29 > 0) Wins = Wins + G29; 
   if(G29 < 0) Loss = Loss + G29;               
   OrderSelect(OrdersHistoryTotal()-28,SELECT_BY_POS,MODE_HISTORY);  
   double G28 = OrderProfit();                                       if(G28 > 0) W ++;        
   if(G28 == 0) G28 = 0.0001; 
   if(G28 > 0) Wins = Wins + G28; 
   if(G28 < 0) Loss = Loss + G28;     

 I want to select the last 30 orders from the ea with the magicnumber 999999 and than calculate the average winn and  average loss amount of the last 30 trades.

Can anybody help me?

Kind Regards

 

Rene  

Respondido

1
Desenvolvedor 1
Classificação
(647)
Projetos
1295
67%
Arbitragem
84
26% / 49%
Expirado
338
26%
Livre
2
Desenvolvedor 2
Classificação
(182)
Projetos
342
42%
Arbitragem
118
12% / 73%
Expirado
104
30%
Livre
Publicou: 4 códigos
3
Desenvolvedor 3
Classificação
(2630)
Projetos
3345
67%
Arbitragem
77
48% / 14%
Expirado
342
10%
Livre
Publicou: 1 código
4
Desenvolvedor 4
Classificação
(14)
Projetos
27
22%
Arbitragem
18
6% / 89%
Expirado
8
30%
Livre
Publicou: 1 código
5
Desenvolvedor 5
Classificação
(618)
Projetos
1428
59%
Arbitragem
31
81% / 0%
Expirado
10
1%
Livre
6
Desenvolvedor 6
Classificação
(88)
Projetos
143
39%
Arbitragem
21
19% / 48%
Expirado
30
21%
Livre
7
Desenvolvedor 7
Classificação
(1928)
Projetos
3548
88%
Arbitragem
73
40% / 15%
Expirado
268
8%
Livre
8
Desenvolvedor 8
Classificação
(16)
Projetos
39
69%
Arbitragem
2
0% / 50%
Expirado
1
3%
Livre
9
Desenvolvedor 9
Classificação
(452)
Projetos
565
26%
Arbitragem
24
42% / 38%
Expirado
85
15%
Livre
Publicou: 6 códigos
10
Desenvolvedor 10
Classificação
(171)
Projetos
229
60%
Arbitragem
3
33% / 33%
Expirado
6
3%
Trabalhando
Publicou: 1 código
11
Desenvolvedor 11
Classificação
(70)
Projetos
86
31%
Arbitragem
1
100% / 0%
Expirado
1
1%
Livre
12
Desenvolvedor 12
Classificação
(12)
Projetos
13
31%
Arbitragem
1
0% / 100%
Expirado
1
8%
Livre
Publicou: 1 código
13
Desenvolvedor 13
Classificação
(47)
Projetos
140
49%
Arbitragem
9
56% / 0%
Expirado
27
19%
Livre
14
Desenvolvedor 14
Classificação
(14)
Projetos
22
27%
Arbitragem
24
13% / 79%
Expirado
6
27%
Livre
15
Desenvolvedor 15
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
16
Desenvolvedor 16
Classificação
(64)
Projetos
144
46%
Arbitragem
19
42% / 16%
Expirado
32
22%
Trabalhando

Informações sobre o projeto

Orçamento
10 - 25 USD