I'm trying to figure out how to find out the percentage of stocks in a "sector" ( S&P 100 for example ) are above their 50 day moving average. If this can be done, I assume you can find the percentage above/below any calculation. I'm sure it's simple, but my mind is melted right now, so let me know how to do it

Thanks!