Finding a subarray of time series data in which all values are less than X for specified time Y?
You don't need a clever or sophisticated algorithm.  It suffices to linearly scan through the time series, in chronological order, and keep track of the length of window of values less than $X$.

At time $t$, remember the length of the longest window ending at time $t$ such that all values in the window are less than $X$.  At time $t+1$, when you see the next value, update this length (it either increases by 1, if the new value is less than $X$, or resets to 0, if the new value is at least $X$).  Keep track of the longest such window that you saw during the entire scan.  If it is longer than $Y$, output it.

This requires very little memory (only an integer to keep track of the length of the window of consecutive values $&lt; X$, and an integer to keep track of the current position in the array).  The algorithm should be extremely fast.