Libraries: Day Of Week

 

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

 

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.