Forex Market Hours

 

Hi guys,

Is it possiable to know when is the market weekly opening and closing time by MQL5 code?

 
if you receive ticks, then you can say that the market is opened. There is the possibility to test Wellington open time market (first market to open on Monday) till NYC closing time on Friday; The DST settings need to be formatted or translated to a non DST GMT time.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Position Properties - Documentation on MQL5
 

SYMBOL_START_TIME

Date of the symbol trade beginning (usually used for futures)

datetime

SYMBOL_EXPIRATION_TIME

Date of the symbol trade end (usually used for futures)

datetime

 

https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Documentation on MQL5
 
FinGeR:

SYMBOL_START_TIME

Date of the symbol trade beginning (usually used for futures)

datetime

SYMBOL_EXPIRATION_TIME

Date of the symbol trade end (usually used for futures)

datetime

 

https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants 

It's not working as expected. 

printf(TimeToString(SymbolInfoInteger(Symbol(),SYMBOL_START_TIME),TIME_DATE|TIME_MINUTES));
printf(TimeToString(SymbolInfoInteger(Symbol(),SYMBOL_EXPIRATION_TIME),TIME_DATE|TIME_MINUTES));


The testing result is :

2011.02.26 11:23:35 testing (EURUSD,H1) 1970.01.01 00:00
2011.02.26 11:23:35 testing (EURUSD,H1) 1970.01.01 00:00

 

The result should be:

2011.02.28 00:00

2011.03.04 23:00 


 

Reason: