I will try to explain how I do it.
Declare these variables at the top:
Then create this method somewhere at the bottom of the EA:
extern int EndHour = 18;
extern int StartHour = 9;
Then in the start function put this:
if(h>EndHour || h<StartHour)
This is for the time filter. I hope to have helped.
StopTrading = false;
//The trading logic of the EA goes here
By the way, for a day filter it is the same except where it says
change it to
And change all the "h" to "d" in the check time function. Also declare the variables at the top for StartDay and EndDay (They are an int ranging from 0-6 and 0 is Sunday, 1 being Monday, etc.