HosseinKOGO: I'm a MQL4 coder and I have just started learning MQL5, I'm newbie :D. I would close open orders at 19:00 Fridays. How can I do this with MQL5? By MQL4 I use DayOfWeek() and Hour(), but they are gone here in MQL5 :|
Read the following article. You will find your answer there.
Also look at https://www.mql5.com/en/forum/429123#comment_40958907
Very similar query - a simple solution lay in using MqlDateTime & TimeToStruct(), which can give you all the time fields you need
A question about time.....
- 2022.07.21
- www.mql5.com
Morning All So I have a snippet of code set up to prompt a MessageBox to make itself known at a certain time (closingTime) which is formatted to an...
Thank you Friends,
Appreciated
Appreciated
Try this:
#include <Tools\DateTime.mqh> CDateTime my_time; my_time.DateTime(TimeCurrent()); //The time you assign here is put into a TimeStruct form automatically Print((string)my_time.day_of_week; //which is public, so you can just call it.
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
Hope you are having a good day!
I'm a MQL4 coder and I have just started learning MQL5, I'm newbie :D
I would close open orders at 19:00 Fridays.
How can I do this with MQL5?
By MQL4 I use DayOfWeek() and Hour(), but they are gone here in MQL5 :|
Your advice is greatly appreciated.