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
(2630)
Progetti
3345
67%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
Gratuito
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
(1928)
Progetti
3548
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%
Gratuito
Pubblicati: 6 codici
10
Sviluppatore 10
Valutazioni
(171)
Progetti
229
60%
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
19
42% / 16%
In ritardo
32
22%
In elaborazione
Ordini simili
Hello. I already have a fully working TradingView indicator written in Pine Script. I am NOT asking for a new strategy or indicator to be designed. I need an experienced NinjaTrader (NinjaScript / C#) developer to replicate the same logic and behavior of my existing TradingView indicator so it works on NinjaTrader. Important points: The TradingView indicator does NOT repaint (uses confirmed bars only). This is logic
No jokers copy pasters allowed. If you're proficient in MQL5, have a proven track record with EAs apply. Commissioning the development of a high-performance Expert Advisor (EA) engineered for the MetaTrader 5 (MT5) environment. The objective is to deploy an institutional-grade automated trading system capable of systematic market analysis, precision execution, and strict risk governance within the global forex
Create an ea that exit buy trades when red smiley face appear,exit sell trades when blue smiley face appear.in this case you need to better use the Smiley face signals which are 4 for BUY (blue smiley face)and 5 For SELL( red smiley face)
I’m looking to acquire an existing, profitable Expert Advisor (EA) with full source code to add to our client investment portfolio. To be clear, this is not a request to develop or design a new strategy. If you already have an EA that is proven, consistent, and production-ready, I’m open to reviewing it immediately. Please apply only if you meet all the requirements below. Submissions without a proper introduction or
Sniper 30+ USD
Hello, I would like you to develop a trading robot (EA) with the following specifications: The robot should be able to target large moves, ideally 60–100 pips or more per trade. It should use high-precision “sniper” entries, focusing on high-probability setups rather than frequent trades. Once the initial trade reaches breakeven, the robot should be able to add additional positions (scale in) while maintaining strict
True 30+ USD
Hello, I would like to commission the development of a trading robot (EA) designed specifically to pass a prop firm challenge within one week, with a maximum allowable drawdown of 2%. Key requirements: Strict risk management with drawdown hard-limits Controlled lot sizing and position management Strategy focused on high-probability, low-risk entries Full compliance with prop firm rules (daily drawdown, max drawdown
I want you to help me and create a sniper entry robot and with proper risk management that follow trend and when is not going to the direction it exit
I need an MQL5 Expert Advisor fixed and compiled. Symbol: XAUUSD Timeframe: M1 Strategy: - Pending order breakout using last 3 candles - Buy Stop +4 points above range - Sell Stop -4 points below range - Lot size: 0.01 fixed - No martingale, no grid, no trailing stop Exits: - Take Profit: 8–10 points - Stop Loss: 10–12 points - Time-based exit: ~75 seconds Risk rules: - Trade only between 09:00 and 17:00 - Max spread
I have been trading manually for years by disciplining myself to follow a rigorous risk management system and using entry and exit strategies crafted from Implied Volatility(IV), Real Volume ,RSI and Moving Average ,but never had I automated the entire system until now . I have just completed the automation of the gold Expert Advisor and the results are astonishing .Below you'll see the graph and a statistics file
Hello budget 30$ I have range breakout expert advisor with pending orders, when the range is complete, the expert sends pending orders, I need to add an option so that when the range is complete, the expert advisor doesn't send pending orders, when the price exceeds the range, the position is opened, executive Orders. I need to make new option True/False True = Executive Orders. False = Pending orders I want the

Informazioni sul progetto

Budget
10 - 25 USD