How to check age of unexecuted pending order?

 

Hi experts,

I've searched the forum but didn't find any topic relevant to my question so here goes.

Is there a way in MQL4 to check how long a pending order has been sitting in the system and has not been executed?

This is more of a sanity check for me to verify the expiration time set for pending order is correctly honoured which I have doubt on and so I can gather evidence to take back to my broker.

Thanks in advance. 

FXD 

 
Use OrderOpenTime() or something like that.
 
deysmacro:
Use OrderOpenTime() or something like that.

 

I'm fairly certain that OrderOpenTime() does not work with pending orders.

What you could do is cycle through your orders and see if TimeCurrent() > OrderExpiration()

 
Pending orders do have order open time.
 
deysmacro:
Pending orders do have order open time.
Quite right - I thought I had some issues with pending orders and OrderOpenTime() in the past, but I've just checked it and OrderOpenTime() does indeed work correctly with pending orders.