For example:
Timefilters.
For any kinds of timefilter, in the beginning of the code type the following:
Code:
extern bool UseHourTrade = True;
extern int FromHourTrade = 8;
extern int ToHourTrade = 17;
1. Timefilter with comments.
After this code
type the following:
Code:
if (UseHourTrade){
if((Hour()>=FromHourTrade)&&(Hour()<=ToHourTrade))
Comment("Trading Hours");
else
{
Comment("Non-trading Hours");
return(0);
}
}
EA will trade from 8 am till last bar (or last tick) before 18.