Use the MATCHING clause in your CCL query to take input from one or more elements (streams, windows, or delta streams) and produce records when a prescribed pattern is found within the input data.
Patterns can check whether or not events occur during a specific time interval, and then send records to downstream streams.
CREATE OUTPUT STREAM ThreeConsecTrades AS SELECT T1.Symbol, T1.Price Price1, T2.Price Price2, T3.Price Price3 FROM QTrades T1, QTrades T2, QTrades T3 MATCHING[5 SECONDS: T1, T2, T3] ON T1.Symbol = T2.Symbol = T3.Symbol ;