Close trades at end of week code ?

 
I am trying to write a code that will close all trades out in the last 10 min of the week.
Is this code correct

exit = (Minute()==50 && Hour()==22 && DayOfWeek()==5);

Thanks
 
In a reverse way could be more efficient.
exit = ( DayOfWeek()==5 && Hour()==22 && Minute()==50);
 
Thanks steve_zhang8
I will try it.....