CTimeControl class for include to your EA for easy setting and checking your own trading time.
An example of usage:
Include:
#include “TimeControl.mqh”
Default constructor:
CTimeControl  timeControl;
Or constructor with days:
CTimeControl timeControl(false, true, true, false, false, false, false);
Or constructor with array of days settings and arrays for trading times in every day:
bool   arrDaysSetting[7] = { false, true, true, false, false, false, false};
int    arrStartHours[7] = { 0, 15, 14, 0, 0, 0, 0};
double  arrStartMinutes[7] = { 0, 15, 14, 0, 0, 0, 0};
int    arrStopHours[7] = { 23, 13, 21, 23, 23, 23, 23};
double  arrStopMinutes[7] = { 0, 15, 14, 0, 0, 0, 0};
CTimeControl timeControl2( arrDaysSetting, arrStartHours, arrStartMinutes, arrStopHours, arrStopMinutes);
For get/set parameter of every day u can use functions with ENUM_DAY_OF_WEEK index for day what u want to set/get:
bool bMonday = timeControl.GetDay(MONDAY);
timeControl.SetDay(MONDAY, true);// enable monday
timeControl.EnableDay(MONDAY);Â Â // enable monday
timeControl.DisableDay(MONDAY);Â // disable monday
int iStartHour, iStopHour;
double dStartMinute, dStopMinute;
timeControl.GetTradingTime(MONDAY, iStartHour, dStartMinute, iStopHour, dStopMinute);
or you can check every day with defined functions:
bool bMonday = timeControl.GetMonday();
timeControl.SetMonday(true); //enable monday
timeControl.EnableMonday();Â //disable monday
timeControl.DisableMonday(); //disable monday
 Main function for check if trading time is enabled (use current server time)
if ( timeControl.IsTradingTime() == true )
{
  //do something
}
else
{
  //do something
}
or you can check your own datetime:
datetime date = D’24.02.2015 12:30:27′;Â
if ( timeControl.IsTradingTime(date) == true )
{
  //do something
}
else
{
  //do something
}