Download MetaTrader 5

Why OrderOpenTime() returns wrong time?

To add comments, please log in or register
Shui Wang
143
Shui Wang  

Hi,

I'm getting wierd result using OrderOpenTime() function. When I place a OP_BUYLIMIT order, it's time (as shown in MT4 terminal) is correct (server time). BUT when it becomes a real BUY order, it's OrderOpenTime changes to about 1 hour later of the current server time!

Why could this happen? Please help, thanks a lot!

sea 

Syed Naufal Gaddafi
1476
Syed Naufal Gaddafi  
When pending orders becomes market orders, broker server will update the open time accordingly.
Shui Wang
143
Shui Wang  

Well this situation i know... 

I mean, its value is about 1 hour AFTER the current time

Simon Gniadkowski
Moderator
18058
Simon Gniadkowski  
seawan:

Well this situation i know... 

I mean, its value is about 1 hour AFTER the current time

TimeCurrent() ?  your PC time ? your Broker's time ?  was the order opened 60 mins ago ?
Shui Wang
143
Shui Wang  

In WT4, the "Market Watch" tab gives the current time (I think it's broker's time).

When I place an pending order, and use OrderOpenTime() on this order, I get the same time value as TimeCurrent() and the above showed time.

When this order turns into real, it's  OrderOpenTime()  changes to another time value (which I can understand) but this value is beyond (after) the TimeCurrent() and the displayed time of the "Market Watch" tab!

(and I'm not saying anything about the time of my own computer...) 

Carl Schreiber
Moderator
7964
Carl Schreiber  
seawan:

In WT4, the "Market Watch" tab gives the current time (I think it's broker's time).

When I place an pending order, and use OrderOpenTime() on this order, I get the same time value as TimeCurrent() and the above showed time.

When this order turns into real, it's  OrderOpenTime()  changes to another time value (which I can understand) but this value is beyond (after) the TimeCurrent() and the displayed time of the "Market Watch" tab!

(and I'm not saying anything about the time of my own computer...) 

Could it be that the NY-DST change last weekend has caused this difference?
Shui Wang
143
Shui Wang  
gooly:
Could it be that the NY-DST change last weekend has caused this difference?
If so, it is a bug of the library function OrderOpenTime(), and could have caused some serious trouble on those relying on this function to look after their budget.
Carl Schreiber
Moderator
7964
Carl Schreiber  
seawan:
If so, it is a bug of the library function OrderOpenTime(), and could have caused some serious trouble on those relying on this function to look after their budget.

The problem is you don't post the relevant information like the journal-tab, the broker time (incl. time zone) - this might have been changed as well due to DST.

But I am quite sure if you start investigating all that you'll find everything is ok.

Simon Gniadkowski
Moderator
18058
Simon Gniadkowski  
seawan:

In WT4, the "Market Watch" tab gives the current time (I think it's broker's time).

When I place an pending order, and use OrderOpenTime() on this order, I get the same time value as TimeCurrent() and the above showed time.

When this order turns into real, it's  OrderOpenTime()  changes to another time value (which I can understand) but this value is beyond (after) the TimeCurrent() and the displayed time of the "Market Watch" tab!

(and I'm not saying anything about the time of my own computer...) 

Isn't that the time at which the Pending --->  an active Buy/Sell Order ?
Shui Wang
143
Shui Wang  
RaptorUK:
Isn't that the time at which the Pending --->  an active Buy/Sell Order ?

Nope. You can see the strange time value on an order created only seconds ago.

And @gooly: when I use MQL functions, there is no place for me to submit those "relevant information"...just OrderPrint(), OrderOpenTime() etc.

Carl Schreiber
Moderator
7964
Carl Schreiber  

And @gooly: when I use MQL functions, there is no place for me to submit those "relevant information"...just OrderPrint(), OrderOpenTime() etc.

With "post" I meant posting here the information from which we might be able to find the clue to your problem.

To add comments, please log in or register