How could i select (retrieve) the latest closed order time?

 

Hi, i'd like to retrieve the latest closed pair  specific (eurusd) closetime. However , i am seeing all related iterations.


How could i choose (retrieve) the recent one?


Responds are appreciated...

 

void OnStart()
  {
//---
   
   
   for( int i = 0; i <= OrdersHistoryTotal() - 1; i++ ) 
{
  if( OrderSelect( i, SELECT_BY_POS, MODE_HISTORY ) )
  {
    if( (OrderSymbol() == "EURUSD") )
    {
       Alert(OrderCloseTime());
    }
  }
  else
     Print( "Error Selecting Order: ", GetLastError() );
}
  
  
  
  
  
  
  
 
  }
 
yyencilek: However , i am seeing all related iterations.


How could i choose (retrieve) the recent one?
  1. Why does that surprise you? That is what your code does. It prints on each one found.
  2. You don't. Go through the list and remember which the most recent one. Print after the loop ends.
 
anyway issue is solved, thanks guys