I suppose if you can predefine stocks within their 5 and 10dma that would be a start. Stockcharts has predefined Continuation Patterns and Doji (Dragonfly & Gravestone) which could indicate a sideways pattern but you'd have to look at the chart to determine how long its been trading that way.