so, for example, you do not want to trade at 13, right? Well, this code will. Because 13 is greater or equal to 10. With all those ORs something is more likely to true.

if((Hour()<=7 || Hour()>=10) || (Hour()<=14 || Hour()>=18))return(0); //Prefer Trading Hours

You might want to code it like this, perhaps:

if((Hour()>=7 && Hour()<=10) || (Hour()>=14 && Hour()<=18))return(0); //Prefer Trading Hours

sn

This is currently working as expected. If is outside this time range the EA does not trade.

if((Hour()<=StartTime || Hour()>EndTime))return(0); //Preferd Trading Hours

From an older EA, which I believed tested successfully but is not working.

if((Hour()<=7 || Hour()>=10) || (Hour()<=14 || Hour()>=18))return(0); //Prefer Trading Hours

Any Ideas why the second option is not working?

I am assuming I can configure & test the following, but was looking for a cleaner solution.

if(Hour()==7 || Hour()==8 || Hour()==9 || Hour()==10 || Hour()==14 || Hour()==15 || Hour()==16 || Hour()==17 || Hour()==18)return(0); //Prefer Trading Hours

Thank you.