
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
A solution could be this one... though not so elegant :-) ....
The drawback is that you have to insert manually the server location GMT offset (in hours) in the servergmt assignment.
Ohhh, come ooonnn ... you are, too ... when you are present and responsive ! :D
Anyway, I looked over the suggested code in the links and the solution is far from elegant. I mean, I have to loop through the sessions of the day, pick the last one (I presume), check if I am between it's open and close time and get the answer. I wonder if I should test for connection as well. Ain't that too much ? Really, guyz, you are "heavy weight" in MQL and in this forum, maybe a little lobby towards MetaQuotes to introduce "MarketInfo(Symbol(), MODE_MARKETOPEN)" isn't such a bad ideea !
Thank you, both, very much indeed !
Titus
I think I'm a litle late, but I agree. Is there not something better?
Also, theses solutions work for holidays and days off?
Thanks
A solution could be this one... though not so elegant :-) ....
The drawback is that you have to insert manually the server location GMT offset (in hours) in the servergmt assignment.
Hi Paolo,
This solution works for holidays and days off too?
Maybe when there's no tick's coming in ??
Or when servertime is frozen ?
Hi everyone, my first contribution :-D
Same issue, different approach: since there is a trade server error "ERR_MARKET_CLOSED", why not try to use it? Idea: try to create a pending order with correct values, so that if it fails, we get this error as a return code. Tried, seems to work fine:
}
I personally find it elegant, but I may be a bit biased :-D
Feedback welcome.
Own feedback:
Found this in another thread: MarketInfo(Symbol(), MODE_TRADEALLOWED)
0 if closed, 1 if open
Seems to work, but compiled literally 1 minute too late to check on my market of choice :-D
Hi all
I would like to check in the expert advisor if the markt is open/close. What's the easiest way to do that?
I don't want do check that over time. I also need to know when the market open again after the short close every day at 11pm.
Thanks
FX_TA