My technique (for automation strategy) is to use multiple timeframe charts along with CCI.
Use a minute based candlestick chart as well as a range based chart. During a sideways period the range chart will exhibit strong sinusoidal qualities, you can use fourier or hilbert transform to separate the component waveforms and then evaluate the number of waveforms and their amplitude.
From there you should be able to identify a pattern that most sideways markets will have (it will likely be slightly different from instrument to instrument), then to calculate possibility of an imminent breakout compare the unfolding curvature with historical data for symmetry or lack thereof, also watch the CCI for impending bursts of momentum.
M. Leyton's work on Symmetry curvature duality and related topics can yield some interesting insights into how to efficiently evaluate an unfolding waveform
I get very good results using this method, of course you cannot predict the beginning of a sideways market with any accuracy but once one begins you can quickly identify and determine whether to sit it out or try to ride it.
Schaum's outline of signals and systems is your friend
(or any of their guides really)