How to exclude certain bars in trading.

 

Is it possible to exclude bars that start at a certain time in an EA? For example if a backtest shows that trades on H! bars of 13, 14, 15, 17,21 and 23 did not do well then how do I exclude them in an EA?

Thanks. 

 
ForexTrader17:

Is it possible to exclude bars that start at a certain time in an EA? For example if a backtest shows that trades on H! bars of 13, 14, 15, 17,21 and 23 did not do well then how do I exclude them in an EA?

Thanks. 

Just check the open time at the start of a new bar. If it's on your "ignore list", don't take the trade.
 

So should I use the function TimeHour then? And how do I exclude only certain hours when signal is given?

Thanks. 

Reason: