How to get the time period during marketing close?

 
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!
 

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.

 
No. I mean how to get the time length of market close period with functions or programing.
 
You have to calculate that yourself - consider the DST at least in the USA - or you google or seek here for a solution
 
see my code