Its never a good idea to trade sideways because you can get caught in a breakout the wrong way.
But if you must trade this way, at least use the Bollinger Bands to help show you where the channel limits are.
When the Bollinger Bands are narrow, trade within the upper/lower and MA. If they start to open up then stop.