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
Published: 4 codes
3
Developer 3
Rating
(2661)
Projects
3382
68%
Arbitration
77
48% / 14%
Overdue
342
10%
Free
Published: 1 code
4
Developer 4
Rating
(14)
Projects
27
22%
Arbitration
18
6% / 89%
Overdue
8
30%
Free
Published: 1 code
5
Developer 5
Rating
(618)
Projects
1428
59%
Arbitration
31
81% / 0%
Overdue
10
1%
Free
6
Developer 6
Rating
(88)
Projects
143
39%
Arbitration
21
19% / 48%
Overdue
30
21%
Free
7
Developer 7
Rating
(1931)
Projects
3552
88%
Arbitration
73
40% / 15%
Overdue
268
8%
Free
8
Developer 8
Rating
(16)
Projects
39
69%
Arbitration
2
0% / 50%
Overdue
1
3%
Free
9
Developer 9
Rating
(452)
Projects
565
26%
Arbitration
24
42% / 38%
Overdue
85
15%
Working
Published: 6 codes
10
Developer 10
Rating
(174)
Projects
232
61%
Arbitration
3
33% / 33%
Overdue
6
3%
Working
Published: 1 code
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
Published: 1 code
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
(64)
Projects
144
46%
Arbitration
20
40% / 20%
Overdue
32
22%
Free
Similar orders
Need to improve logic in existing coding for Range breakout/breakin EA 1) for timing range like 1am-10am Asian Range with max entry per session like London 1-2 times max entry 10-4pm & US session timings 1-2 entry 4pm - 8pm or 2) candle high low range eg 4pm to 4:30pm - entry logic eg mark 30min candle high low range as given in attached picture with buffer if required to show entry , SL & TP in trade/backtest mode
Make a Robot for mt5 using supertrend indicator for entry in trade with period 2 and multiplier 1.1 using Heiken Ashi candle also with martingle of 2 with maximum step for martingle is 15 step until profit reaches double of total loss. Select time frame 1 minute.Always close the previous trade if in loss then take next trade with martingle of 2 of previous lot in loss. All parameter have the option to change it
Robot que combine 2 indicadores en la ejecución automatica: 1 el Gann High Low y el Donchian Channel (DC) ACTIVO: XAU/USD EN UNA HORA PARA EL DC: período DC = 55 velas displacement/shift = 1 Mas Detalles en este video : https://youtu.be/3jI3cZY89T4?si=YEZAkMvWiq9O8-u9
Hello, I need an Expert Advisor for both MT4 and MT5 based on a recovery/grid trading strategy. Strategy Logic: User manually opens either a Buy or Sell market order. Once the first trade is opened, the EA automatically places an opposite pending order at a user-defined distance. If the pending order gets triggered, the EA places another opposite pending order at the original order price. This cycle continues
📌 Project Overview: I need a full Smart Trade Management System for MetaTrader 4/5. This is a complete trading ecosystem, not a simple EA. 📌 Core Features: Smart Money Management (risk-based lot calculation) Advanced Trading Toolbox (TradingView-style drawing tools) Central Master Dashboard (risk, filters, account control) Multi-account monitoring (MT4/MT5 synchronization) Real-time monitoring (spread, equity
We are seeking an experienced MQL5 developer to build the Guardian EA, a focused circuit-breaker module for MetaTrader 5. Objective Protect capital during adverse moves by temporarily exiting positions at a defined drawdown threshold, while virtually tracking those positions as open. Re-establish the positions only when market conditions stabilize (via ADX) and drawdown recovers to a lower threshold. The goal is full
Hi basically I'm wanting an already made EA scalper that's constantly in and out of trades on the M1 time frame that has good risk management. It knows what it's doing. Most of its trades are profitable and that can start with £100. I am willing to pay up to £1000 for the right scalping bot. If you please have one and you're very confident in it, please allow me to use a live version to see how it does and if I'm
hello good evening All professional programmers! I'd like to request a special services I need a Gold and Silver trading bot like the one in the video, one that works on real accounts. My only request is that I don't pay any money until the bot is built and tested. Thank you very much please contact me as soon as possible for more information
https://youtu.be/mUoczuxL0XE?si=2IzxX4jhML_-4f47&nbsp ; ...... “Secret London Session CRT Model - Insane Accuracy | ICT Secrets.” The model is called London Twilight and focuses on quick scalps near the end of London session. Source summary notes it uses CRT + Turtle Soup + PO3/AMD , mainly between 3:00 AM and 5:00 AM EST/New York time . ( Video Highlight | AI Video Summarizer ) Give your MQL5 coder these rules
I'm looking for a buy sell indicator that places signals at candle close doesn't repaint. Looking for strategy too as part of this project. Will want to see it before I create the contract. Please don't send me stuff you know isn't good. If done well will pay well and it can turn I to a long term collaboration

Project information

Budget
10 - 25 USD