best way to rank stocks

Discussion in 'Trading' started by barkbark, Mar 25, 2024.

  1. barkbark

    barkbark

    My goal is to create a python script that will take a watch list and rank the stocks according to how well they perform under a particular strategy.

    What method would best accomplish this?
     
    murray t turtle likes this.
  2. A good start is sector [groups]
     
  3. ph1l

    ph1l

    Unless I'm missing something, the ranking part is trivial.

    1. For each stock in your universe, calculate a metric for how it performs with your strategy.
    2. Sort best-to-worst by metric value.
    3. The rank of an individual stock is the position in the output.

    Example: for 800 ETFs, I calculate a daily Sharpe ratio for three years of price data (adjusted for splits and dividends):
    Code:
    mean (daily return proportion- daily risk-free return proportion) /
    sampleStandardDeviation(daily return proportion- daily risk-free return proportion)
    Symbols and Share ratio sorted on high-to-low Sharpe ratio are in the attached etf_sharpe_ratios.txt
     
    Last edited: Mar 25, 2024
  4. Well, what you want to do is use your strategy on each stock to see how well it does. For example, if your strategy involves looking at moving averages (which is like an average price over a certain period), you could figure out how much money you would have made on average when the stock's price is higher than this moving average. It's like checking each stock to see how well it matches your game plan and then writing down the scores to compare them later.
     
  5. Sekiyo

    Sekiyo

    These are TOP 200 stocks by activity (volume x price)
    Average 52W %FromHigh & %FromLow rank.

    upload_2025-4-1_21-25-27.png

    I like TMUS

    upload_2025-4-1_21-27-35.png

    Another way to rank stocks is by sharpe or efficiency ratio
    Over 3, 6 and / or 12 months.
     
    Last edited: Apr 1, 2025
    TrailerParkTed and Picaso like this.
  6. 2rosy

    2rosy

    CAGR
     
    Sekiyo likes this.
  7. Sekiyo

    Sekiyo

    IMG_2073.jpeg