Select last 30 orders in history with magic number 999999 MQL4

MQL4 Esperti Script

Lavoro terminato

Tempo di esecuzione 3 minuti
Feedback del 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.

Specifiche

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  

Con risposta

1
Sviluppatore 1
Valutazioni
(647)
Progetti
1295
67%
Arbitraggio
84
26% / 49%
In ritardo
338
26%
Gratuito
2
Sviluppatore 2
Valutazioni
(182)
Progetti
342
42%
Arbitraggio
118
12% / 73%
In ritardo
104
30%
Gratuito
Pubblicati: 4 codici
3
Sviluppatore 3
Valutazioni
(2661)
Progetti
3382
68%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
In elaborazione
Pubblicati: 1 codice
4
Sviluppatore 4
Valutazioni
(14)
Progetti
27
22%
Arbitraggio
18
6% / 89%
In ritardo
8
30%
Gratuito
Pubblicati: 1 codice
5
Sviluppatore 5
Valutazioni
(618)
Progetti
1428
59%
Arbitraggio
31
81% / 0%
In ritardo
10
1%
Gratuito
6
Sviluppatore 6
Valutazioni
(88)
Progetti
143
39%
Arbitraggio
21
19% / 48%
In ritardo
30
21%
Gratuito
7
Sviluppatore 7
Valutazioni
(1931)
Progetti
3552
88%
Arbitraggio
73
40% / 15%
In ritardo
268
8%
Gratuito
8
Sviluppatore 8
Valutazioni
(16)
Progetti
39
69%
Arbitraggio
2
0% / 50%
In ritardo
1
3%
Gratuito
9
Sviluppatore 9
Valutazioni
(452)
Progetti
565
26%
Arbitraggio
24
42% / 38%
In ritardo
85
15%
In elaborazione
Pubblicati: 6 codici
10
Sviluppatore 10
Valutazioni
(174)
Progetti
232
61%
Arbitraggio
3
33% / 33%
In ritardo
6
3%
In elaborazione
Pubblicati: 1 codice
11
Sviluppatore 11
Valutazioni
(70)
Progetti
86
31%
Arbitraggio
1
100% / 0%
In ritardo
1
1%
Gratuito
12
Sviluppatore 12
Valutazioni
(12)
Progetti
13
31%
Arbitraggio
1
0% / 100%
In ritardo
1
8%
Gratuito
Pubblicati: 1 codice
13
Sviluppatore 13
Valutazioni
(47)
Progetti
140
49%
Arbitraggio
9
56% / 0%
In ritardo
27
19%
Gratuito
14
Sviluppatore 14
Valutazioni
(14)
Progetti
22
27%
Arbitraggio
24
13% / 79%
In ritardo
6
27%
Gratuito
15
Sviluppatore 15
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
16
Sviluppatore 16
Valutazioni
(64)
Progetti
144
46%
Arbitraggio
20
40% / 20%
In ritardo
32
22%
Gratuito
Ordini simili
I need a professional MQL5 developer to build a fully automated Expert Advisor (EA) named " Hassanien Daily Breakout ". The EA is based on daily price levels and specific execution times. ​ Technical Specifications: ​ Time Settings (Iraq Time - GMT+3): ​ Execution Time: 10:00 AM. ​ Full Clean-up Time: 10:50 PM (Close all open positions and delete pending orders). ​ Entry Logic: ​ Case 1 (Pending Orders): At 10:00 AM
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 $1500 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
Need an trailing SL manager which can work with my all open trades (trades may be multiple), Put a fix SL based on entry price and then trail my strictly in my favoured direction, Initial SL shud be confiurable via a small dashboard
Pip killer ntt 100+ USD
Create a forex robot especially for sculping using the 3 ema strategy which consists of the following moving average levels of the 15 ma ,30 ema , 60 ema and 90 which enter potentially on a retest into the ema and targets opposite direction after the retest .Potentially bringing into account that the number of retested emas controlls the number of entreis which for eg. retest of the 15 ema single 0.01 trade is
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

Informazioni sul progetto

Budget
10 - 25 USD