Suppose I want to create a stock universe (based on daily price bars) filtered to include only those stocks that meet these two conditions:

1. Open price today gaps up from yesterday's close by more than X%

2. Price today and yesterday are both above the 50 day simple moving average.

Is there any way to filter stocks based on where the price is with respect to a moving average? What about filtering on other indicators like RSI or stochastics?