MQL4: Last closed order - I looking for the IDEA

 

Here Ya Go.

//#################################################################
//#################################################################
int start(){
//#################################################################
//#################################################################
for(int a=OrdersHistoryTotal()-1;a>=0;a--){
   if(OrderSelect(a,SELECT_BY_POS,MODE_HISTORY)==true){
      int Ticket=OrderTicket();Alert(Ticket);break;
   }
}
//#################################################################
//#################################################################
return(0);}
//#################################################################
//#################################################################

In function Mode:

//#################################################################
//#################################################################
int Get_LastClose(){
//#################################################################
//#################################################################
for(int a=OrdersHistoryTotal()-1;a>=0;a--){
   if(OrderSelect(a,SELECT_BY_POS,MODE_HISTORY)==true){
      int Ticket=OrderTicket();break;
   }
}
//#################################################################
//#################################################################
return(Ticket);}
//#################################################################
//#################################################################
 
ubzen:

Here Ya Go.

In function Mode:


Thanks a LOT! You have one beer from me - COLD BRONEK for YOU!
Reason: