Download MetaTrader 5

How to check age of unexecuted pending order?

To add comments, please log in or register
fxdaemon
32
fxdaemon  

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 

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
Use OrderOpenTime() or something like that.
honest_knave
Moderator
2328
honest_knave  
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()

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
Pending orders do have order open time.
honest_knave
Moderator
2328
honest_knave  
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.
To add comments, please log in or register