How to Select The Last Closed Order?

 

Hi!

So how do I do that?

 
t0mbfunk:

Hi!

So how do I do that?

Loop through all he closed orders selecting them one by one, check the OrderCloseTime() time and remember the OrderTicket() when you find an order with a larger/newer OrderCloseTime() when you get to the end of the loop you have the ticket for the most recently closed Order.
 

Thank you, thats exactly what I needed.