Take alook at the entire code and add 1 function to limit number of orders

Job finished

Execution time 41 minutes
Feedback from customer
Very good programmer, take a time to teach you on what modification he make :) Good teacher :) Thank you !
Feedback from employee
Good customer! thank you for the job!

Specification

Hello, look at the entire code, check that it is programmed correctly, that there are no functions that are useless! Add a function so that there is only 1 order per currency pair. Currently it can happen that there are 2 or 3 orders per currency pair, I want to limit the number of orders to 1 per currency pair.


Add a code like this example :

int TotalOrders(string symbol="", ulong magic = -1) {

   int cnt = 0;

   int pos_total = PositionsTotal();

   for(int pos =pos_total-1;pos>=0;pos--)  {

      ulong pos_ticket = PositionGetTicket(pos);

      if(PositionSelectByTicket(pos_ticket) && (symbol=="" || PositionGetSymbol(POSITION_SYMBOL)==symbol) && ( magic==-1 || PositionGetInteger(POSITION_MAGIC)==magic) ) {

      cnt++;   

      }

   }

   return(cnt);

}


it's just an example of what I want, it can be programmed differently.


Files:

MQ5
deep1.mq5
11.3 Kb

Responded

1
Developer 1
Rating
(209)
Projects
281
46%
Arbitration
27
59% / 37%
Overdue
36
13%
Free
2
Developer 2
Rating
(22)
Projects
23
39%
Arbitration
0
Overdue
1
4%
Free
3
Developer 3
Rating
(8)
Projects
12
0%
Arbitration
22
0% / 77%
Overdue
4
33%
Free
4
Developer 4
Rating
(57)
Projects
72
22%
Arbitration
13
46% / 15%
Overdue
5
7%
Free
5
Developer 5
Rating
(43)
Projects
66
12%
Arbitration
12
58% / 42%
Overdue
1
2%
Free
6
Developer 6
Rating
(272)
Projects
367
71%
Arbitration
18
33% / 44%
Overdue
14
4%
Free
Published: 14 codes
Similar orders
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi
Need a HFT scalping EA 30 - 100 USD
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
Pazuzu 30+ USD
generate or create me a python coded file that has mql5 language requirements for a trading bot under the following instructions. the bot must execute trades if necessary the bot must trade 24/7 the bot must trade gold and currency the bot must make unlimited profit hourly the bot must enter market with caution after market analysis of 98 percent of clear trade

Project information

Budget
30+ USD
Deadline
to 1 day(s)