When it is clear that the market is going nowhere, it is best to "do the opposite" of what the market has most recently done. In other words, when rangebound, go short when overbought near the top of the range, and go long when oversold near the bottom of the range. Repeat that action until you lose money on your last trade.
The two charts at right make pretty clear what any trend. . .