Another idea for a filter could be to say that the close of the current bar must be higher or lower than the high or the low of the previous bar that is 2 bars back. This way you avoid the tight ranging areas for the most part.
Of course, the close would also have to be above the 21 sma for a buy and below for a sell..
Of course, the close would also have to be above the 21 sma for a buy and below for a sell..