Unless I'm missing something, the ranking part is trivial.
For each stock in your universe, calculate a metric for how it performs with your strategy.
Sort best-to-worst by metric value.
The rank of an individual stock is the position in the output.
Example: for 800 ETFs, I calculate a...