MQL4参考 日期和时间 DayOfWeek

DayOfWeek

Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.

int  DayOfWeek();

Returned value

Current zero-based day of the week (0-Sunday,1,2,3,4,5,6).

Note

At the testing, the last known server time is modelled.

Example:

  // do not work on holidays.
  if(DayOfWeek()==0 || DayOfWeek()==6) return(0);