error message 'DayOfWeek' - wrong parameters count

 

Hi Experts, 

i need help. i want my ea to stop trade on friday

I use the dayofweek function. below is my code, 


   

   int        dayOfWeek = DayOfWeek(TimeCurrent());

    if (dayOfWeek == 5) // 5 is for Friday

    {

        return (0);

    }


But the mql compiler stated error message "DayOfWeek' - wrong parameters count" can someone provide some advise how to fix it ? thanks

 
  1. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor

  2. Perhaps you should read the manual. DayOfWeek takes no paremeter. TimeDayOfWeek does.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  3. Don't hard code constants.
    Use the proper enumerations (ENUM_DAY_OF_WEEK)
    if (dayOfWeek == FRIDAY) // 5 is for Friday