Download MetaTrader 5

Forex Market Hours

To add comments, please log in or register
Interested in Signals activity? Come and track!
Kevin
44
Kevin 2011.02.25 14:04 

Hi guys,

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

muller
559
muller 2011.02.25 16:40  
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
Alexander Piechotta
6953
Alexander Piechotta 2011.02.25 22:08  

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
Kevin
44
Kevin 2011.02.26 06:25  
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 


 

To add comments, please log in or register