Something else like that:
datetime DateOfWeekDay( int Year, // Year. int Month, // The Monthly int DayOfWeek, // Day of the week (0-6) int DayOfWeekNum // The sequence number of the day specified in DayOfWeek from the beginning of the month (e.g. // first Friday, second Friday, etc.). Counting from 1. ){ MqlDateTime ts; ts.year=Year; ts.mon=Month; ts.day=1; ts.hour=0; ts.min=0; datetime tm=StructToTime(ts); TimeToStruct(tm,ts); int fwd=(DayOfWeek-ts.day_of_week+7)%7; tm+=fwd*86400+(DayOfWeekNum-1)*604800; return(tm); // Date of the searched day }
Seems like a joke. Data are hard coded in the .mqh.
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
Day Of Week:
The "Day of Week" function is designed to determine the number of required month according to data of the week and the day of the week inside this month
Author: Dmitriy Zabudskiy