Select last 30 orders in history with magic number 999999 MQL4

MQL4 Experts Scripts

Job finished

Execution time 3 minutes
Feedback from customer
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.

Specification

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  

Responded

1
Developer 1
Rating
(647)
Projects
1295
67%
Arbitration
84
26% / 49%
Overdue
338
26%
Free
2
Developer 2
Rating
(182)
Projects
342
42%
Arbitration
118
12% / 73%
Overdue
104
30%
Free
3
Developer 3
Rating
(2441)
Projects
3076
66%
Arbitration
77
48% / 14%
Overdue
340
11%
Free
4
Developer 4
Rating
(14)
Projects
27
22%
Arbitration
18
6% / 89%
Overdue
8
30%
Free
5
Developer 5
Rating
(554)
Projects
1342
59%
Arbitration
28
82% / 0%
Overdue
10
1%
Working
6
Developer 6
Rating
(88)
Projects
143
39%
Arbitration
21
19% / 48%
Overdue
30
21%
Free
7
Developer 7
Rating
(1859)
Projects
3463
88%
Arbitration
73
40% / 15%
Overdue
265
8%
Free
8
Developer 8
Rating
(16)
Projects
39
69%
Arbitration
2
0% / 50%
Overdue
1
3%
Free
9
Developer 9
Rating
(440)
Projects
546
25%
Arbitration
21
38% / 38%
Overdue
83
15%
Working
10
Developer 10
Rating
(130)
Projects
186
54%
Arbitration
3
33% / 33%
Overdue
6
3%
Free
11
Developer 11
Rating
(70)
Projects
86
31%
Arbitration
1
100% / 0%
Overdue
1
1%
Free
12
Developer 12
Rating
(12)
Projects
13
31%
Arbitration
1
0% / 100%
Overdue
1
8%
Free
13
Developer 13
Rating
(47)
Projects
140
49%
Arbitration
9
56% / 0%
Overdue
27
19%
Free
14
Developer 14
Rating
(14)
Projects
22
27%
Arbitration
24
13% / 79%
Overdue
6
27%
Free
15
Developer 15
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
16
Developer 16
Rating
(62)
Projects
140
46%
Arbitration
19
42% / 16%
Overdue
32
23%
Free
Similar orders
Martingale EA for MT5 30 - 100 USD
Criteria: Only one trade at a time. Cannot open another trade if one is running Trade on EURUSD only, once job is completed I will be happy to schedule more for other pairs You choose entry strategy and criteria win rate must be above 50% in long term backtest of EURUSD Every trade has got TP and SL Trades to last about a day, few trades a week, at least 10 pips gain per trade, so that it can be launched on normal
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Im looking for an coder to code an EA: Trade management 1. opening trades according to the indicator 2. trades settings to choose from like: open all trades according to the signal open only trade 1,2,3 or 4 % per trade ( example 50/30/20 of the lot settings, with 4 trades it would be for example 50/30/10/10) 3. SL/Trailing settings: Move SL to entry after hitting TP1/TP2 or TP3 moving SL by % keep the original SL
Hi I'm looking to have 2 of my pinescript strategies converted to MQL5 and was wondering if you could first give me a quote for the more simple strategy and then for both the simple and complex strategy together. The simple strategy is a MACD crossover type thing that uses a special EMA script that filters out some ranging price action and also fractal candles for the stop loss. The second strategy is market
I want grate robot for making profits that know when to start a good trade and close a trade and must be active all time to avoid lost of money
I have developed a very strong TradingView strategy in Pine Script but unfortunately, a third-party connector is requiired and in my opinion, I want a more direct connection. I am not brilliant at coding, but I have coded the majority of the MT5 code and I would like you to make sure that the MT5 code matches my TradingView script and executes the same way as the TradingView script that I will provide if you are
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Dr Pattern 30+ USD
good day i need the service of the seaso coder to help me fix my ea The Job required 1 knowledge of Mt4 and Mt5 indicator coding 2. Telegram code 3. ability to code indicator to work on multiple Time frame combine to trade 4 Ability to Join two or three indicator on same ir different time frame if you have these skill please let chart i will discuss the details of the Job inside to you The required day including

Project information

Budget
10 - 25 USD
VAT (21%): 2.1 - 5.25 USD
Total: 12.1 - 30.25 USD
For the developer
9 - 22.5 USD