Download MetaTrader 5

How to get the time period during marketing close?

To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
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
6587
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
6587
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
14489
whroeder1 2014.11.13 21:26  
To add comments, please log in or register