Calculations › Market Discovery

Which sector stocks are near their 52-week low with an analyst Buy rating? (edit the sector filter)

The query

SELECT tn.ticket AS symbol, sm.name, sm.sector,
  ROUND(tp_latest.price::numeric, 2) AS price,
  ROUND(sm.fifty_two_week_low::numeric, 2) AS fifty_two_week_low,
  ROUND(sm.fifty_two_week_high::numeric, 2) AS fifty_two_week_high,
  ROUND(((tp_latest.price - sm.fifty_two_week_low) / NULLIF(sm.fifty_two_week_high - sm.fifty_two_week_low, 0))::numeric, 4) AS pct_of_52w_range,
  sm.recommendation_key
FROM ticketname tn
JOIN symbolmetadata sm ON sm.ticketnameid = tn.id
JOIN LATERAL (
  SELECT price FROM ticketprice tp WHERE tp.ticketnameid = tn.id ORDER BY tp.datetime DESC LIMIT 1
) tp_latest ON true
WHERE tn.tickettype = 'stock'
  -- "Banking" is filed under Yahoo's "Financial Services" sector (also covers insurers, fintech, asset managers).
  -- Other sectors in this data: Technology, Healthcare, Industrials, Consumer Cyclical, Communication Services,
  -- Real Estate, Basic Materials, Consumer Defensive, Energy, Utilities.
  AND sm.sector = 'Financial Services'
  AND sm.market_cap > 100000000
  AND sm.recommendation_key IN ('buy', 'strong_buy')
  AND sm.fifty_two_week_high IS NOT NULL AND sm.fifty_two_week_low IS NOT NULL
ORDER BY pct_of_52w_range ASC
LIMIT 15

Runs against Cryptobi's market tables — ticketname (symbols), ticketprice (daily prices and volume) and symbolmetadata (sector, exchange, market cap and other reference fields).

Current output

SymbolNameSectorPriceFifty two week lowFifty two week high% of 52w rangeAnalyst view
COIN Coinbase Global, Inc. Financial Services 105.14 101.97 277.36 0.02 buy
VNV.ST VNV Global AB (publ) Financial Services 16.50 16.08 22.04 0.07 strong_buy
KLAR Klarna Group plc Financial Services 13.55 12.01 32.50 0.07 buy
MARA MARA Holdings, Inc. Financial Services 5.84 5.09 14.85 0.08 buy
VEFAB.ST VEF AB (publ) Financial Services 1.63 1.52 2.42 0.12 strong_buy
BAC Bank of America Corporation Financial Services 48.95 46.72 64.81 0.12 strong_buy
TAALA.HE Taaleri Oyj Financial Services 7.16 6.99 7.89 0.19 strong_buy
ENITY.ST Enity Holding AB Financial Services 83.90 67 114.50 0.36 strong_buy
EQT.ST EQT AB (publ) Financial Services 307 261.90 374.70 0.40 buy
NOBA.ST NOBA Bank Group AB Financial Services 97.30 74.40 124.80 0.45 buy
CM.TO Canadian Imperial Bank of Commerce Financial Services 148.31 127.87 171.76 0.47 buy
SLF.TO Sun Life Financial Inc. Financial Services 101.57 85.26 118.69 0.49 buy
JPM JPMorgan Chase & Co. Financial Services 323.94 282.84 365.18 0.50 buy
FSBC Five Star Bancorp Financial Services 41.99 34.14 49.68 0.50 buy
DBK.DE Deutsche Bank Aktiengesellschaft Financial Services 30.47 24.76 35.75 0.52 buy

Live output, first 15 rows, refreshed periodically. Model estimates are trend projections from recent prices, not financial advice.

Run this on your own holdings, change it, or write your own in SQL or Python — then put it on a dashboard or have it emailed on a schedule. Free, no credit card.

Sign Up Free

Related calculations