[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 381

 
Hi! Can you tell me how to modify all orders of the same type?
 
Skif_7:
Hi, could you tell me how to modify all orders of the same type?
OrderModify(). From the list of orders we have to select the corresponding orders one by one and modify them.
 
(Anyone know how to find the last closed order!))
 
lowech:
(Anyone know how to find the last closed order!))

int FindOrder(int SysID, string smb, double &prop) // возвращает тикет ордера
{
        int ticket=0, total=OrdersHisoryTotal(); if (total<=0) return(0);
        prop=0; // property which needed
        for(int i=0; i<total; i++) 
        { 
                if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) return(-1);
                if (OrderMagicNumber()!=SysID || (OrderSymbol()!=smb&&smb!="")) continue;
                if (prop<OrderCloseTime() || ticket<=0)  { prop=OrderCloseTime(); ticket=OrderTicket(); }
        }
        return(ticket);
}
 
lowech:
(someone knows how to find the last closed order!))

Or so it seems:

 datetime LastCloseTime() {
   datetime CloseTime;
   for(int i=OrdersTotal()-1; i>=0; i--){
     if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))continue;
     if(OrderSymbol()!=Symbol())continue;
     if(OrderMagicNumber()!=Magic) continue;
     if(OrderType()>1)continue;
     if(CloseTime<=OrderCloseTime())CloseTime=OrderCloseTime();
   }
 return(CloseTime);}
//=======================================================================================================
 

Good day to you all.

Can you tell me if it is possible to create a loop to search variables and assign a value to them For example:

I need to search 20 variables C1, C2, C3, etc. and in the course of the search assign them values.

If it is possible tell me how?

Regards Gek.

 
Gek34:

Good day to you all.

Can you tell me if it is possible to create a loop to search variables and assign a value to them For example:

I need to search 20 variables C1, C2, C3, etc., and in the course of the search assign them values.

If it is possible tell me how?

Regards Gek.

int i = 0;
int anAr[20] = {0};
for (i = 0; i < 20; i++)
 {
  anAr[i] = i;    // Присваиваем.
  Print(anAr[i]); // Выводим.
 }
for (i = 0; i < 20; i++)
 {
  Print(anAr[i]);   // Выводим.
  anAr[i] = 20 - i; // Присваиваем.
  Print(anAr[i]);   // Выводим.
 }
 
Please advise how to install MT4/MT5 if access to the internet is via proxy with password, but MT does not ask for proxy when installing
 
Zhunko:



Thank you very much, I understand the principle.
 

People, which of the standard indicators can be used to identify a flat?

or more precisely which is the best of the standard ones... :)