I need MQL4 Code converted to MQL5 code

MQL5 Converting

Job finished

Execution time 2 hours
Feedback from customer
Great developer, i will hire him again...

Specification


I Need to convert MQL4 code to MQL5. Make it is working as same as MT4 do.  It is small Code I need this today. Code is Below -


 datetime start_date = TimeCurrent()-1000;
      
         double lots1,prices,prices_c,swap,pricesBuy,lotsbuy,pricesSell,lotssell;

         for (int i=OrdersHistoryTotal()-1; i>=0; i--)
         {
            if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))
            {
               if (OrderSymbol() == _Symbol && (OrderType() == OP_SELL || OrderType() == OP_BUY) && doMagic() && OrderCloseTime()!=0)
               {
                  if ( OrderCloseTime() >= start_date) 
                  { 
                     lots1 = lots1 + OrderLots();
                     prices = prices + (OrderOpenPrice() * OrderLots());
                     prices_c = prices_c + (OrderOpenPrice() * OrderLots());
                     swap = swap + OrderSwap();  
               
                     if(OrderType()==OP_BUY){
                        pricesBuy = pricesBuy + (OrderOpenPrice() * OrderLots());
                        lotsbuy = lotsbuy + OrderLots();
                     }
                     else if(OrderType()==OP_SELL){
                        pricesSell = pricesSell + (OrderOpenPrice() * OrderLots());
                        lotssell = lotssell + OrderOpenPrice();
                     }
                  }
                  
                  if ( OrderCloseTime() < start_date) break;      
               }   
            }
         }  


Responded

1
Developer 1
Rating
(163)
Projects
258
61%
Arbitration
4
50% / 25%
Overdue
10
4%
Free
2
Developer 2
Rating
(590)
Projects
789
71%
Arbitration
9
33% / 33%
Overdue
22
3%
Free
Published: 8 codes
3
Developer 3
Rating
(647)
Projects
1295
67%
Arbitration
84
26% / 49%
Overdue
338
26%
Free
4
Developer 4
Rating
(26)
Projects
23
39%
Arbitration
26
8% / 38%
Overdue
0
Free

Project information

Budget
30+ USD
Deadline
from 1 to 2 day(s)