Simple test to determine if market is closed?

 
I know I can check the hours but is there a simple test that can be done to determine if the market is open or closed?
 
You can not open the trade because market is close
 
ingvar_e:
I know I can check the hours but is there a simple test that can be done to determine if the market is open or closed?
In which context ?
 
angevoyageur:
In which context ?

  context?

  I just want to avoid placing trades or modify running orders when the market is closed in order not to mess up the log. It is an EA running 24/7

Just thought a little more about it and decided that it will work if I confine myself to do order type commands in the "start" routine. No ticks coming from a closed market

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
ingvar_e:

  context?

  I just want to avoid placing trades or modify running orders when the market is closed in order not to mess up the log. It is an EA running 24/7

Just thought a little more about it and decided that it will work if I confine myself to do order type commands in the "start" routine. No ticks coming from a closed market

Yes, this is why I was asking " in which context" do you need to know i market is closed.
 
start routine only runs when mt4 client terminal receive a new tick ... if the market is closed .. then there is no tick .. means start routine will not be called ... means your EA will not place any order .. means relax .. nothing gonna happen :)