Download MetaTrader 5
To add comments, please log in or register
Hundreds of articles will help you to create a trading robot. Come and read them!
fxdaemon
32
fxdaemon 2014.10.09 00:02 

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 2014.10.09 00:08  
Use OrderOpenTime() or something like that.
honest_knave
951
honest_knave 2014.10.09 00:31  
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 2014.10.09 01:09  
Pending orders do have order open time.
honest_knave
951
honest_knave 2014.10.09 08:27  
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