Download MetaTrader 5
To add comments, please log in or register
All articles are available from MetaTrader 5. Contribute your own one!
Shui Wang
132
Shui Wang 2014.11.05 10:59 

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
1401
SYED NAUFAL GADDAFI 2014.11.05 11:12  
When pending orders becomes market orders, broker server will update the open time accordingly.
Shui Wang
132
Shui Wang 2014.11.05 11:13  

Well this situation i know... 

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

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.11.05 11:28  
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
132
Shui Wang 2014.11.05 11:38  

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
5965
Carl Schreiber 2014.11.05 11:57  
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
132
Shui Wang 2014.11.05 12:01  
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
5965
Carl Schreiber 2014.11.05 12:55  
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
17963
Simon Gniadkowski 2014.11.05 20:31  
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
132
Shui Wang 2014.11.12 10:18  
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
5965
Carl Schreiber 2014.11.12 13:06  

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