code to not trade during certain times

 
Hi, I need assistance with coding to get my EA to not enter trades during specific times. For example. I want the EA to not trade if the time is between 15:00 and 17:00 and time between 10:00 and 12:00. Any assistance is greatly appreciated.
 
Put on the beginning:
if((Hour()>=10&&Hour()<12)||(Hour()>=15&&Hour()<17)) return(0);
 

This question is asked weekly. Please search the forum before posting.

Thanks.


CB