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?
- Feature in StrategyTester
- Find out if a trade was stopped out
- Test if optimizing
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 ?
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?
angevoyageur:
In which context ?
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](/i/community/logo_mql5_small.png)
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:
Yes, this is why I was asking " in which context" do you need to know i market is closed.
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
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 :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register