Download MetaTrader 5
To add comments, please log in or register
Share your knowledge. Become a well-known developer!
moonsboy
889
moonsboy 2014.11.13 05:18 
Who can help tell how to get the time period during marketing close? e.g. market close during weekend and holiday, how to detect and calculate the time period? Thanks for help!
Carl Schreiber
5930
Carl Schreiber 2014.11.13 07:19  

What do you mean by time period?

1) TimeCurrent() is the (broker-) time of the last tick, e.g. Fr. 22:59 (the whole weekend).

2) If the market is closed this isn't changed and OnTick() is not called.

3) The only way you get the actual time is either TimeLocal() (PC-time) or TimeGMT() (PC-GMT-Time).

4) If you know the GMT-Shift of your broker you can calculate the 'theoretical' TimeCurrent() yourself.

moonsboy
889
moonsboy 2014.11.13 08:13  
No. I mean how to get the time length of market close period with functions or programing.
Carl Schreiber
5930
Carl Schreiber 2014.11.13 11:24  
You have to calculate that yourself - consider the DST at least in the USA - or you google or seek here for a solution
whroeder1
13593
whroeder1 2014.11.13 21:26  
/
To add comments, please log in or register