Calculations › Market Discovery

Show the top 20 stocks in the market by 30-day % gain (ideas to research)

The query

-- table market-wide: top 20 stock movers (discovery - stocks to consider)
WITH latest AS (
  SELECT DISTINCT ON (tp.ticketnameid) tp.ticketnameid, tp.price AS price_now, tp.datetime AS ts_now
  FROM ticketprice tp JOIN ticketname tn ON tn.id = tp.ticketnameid
  WHERE tn.tickettype = 'stock'
  ORDER BY tp.ticketnameid, tp.datetime DESC
),
month_ago AS (
  SELECT DISTINCT ON (tp2.ticketnameid) tp2.ticketnameid, tp2.price AS price_1m
  FROM ticketprice tp2 JOIN latest l ON l.ticketnameid = tp2.ticketnameid
  WHERE tp2.datetime <= l.ts_now - 30*86400
  ORDER BY tp2.ticketnameid, tp2.datetime DESC
)
SELECT tn.ticket AS symbol, COALESCE(sm.name, tn.ticketname, tn.ticket) AS name, sm.sector,
       l.price_now, (l.price_now - m.price_1m) / NULLIF(m.price_1m,0) * 100 AS pct_change_1m
FROM latest l
JOIN month_ago m ON m.ticketnameid = l.ticketnameid
JOIN ticketname tn ON tn.id = l.ticketnameid
LEFT JOIN symbolmetadata sm ON sm.ticketnameid = l.ticketnameid
WHERE l.price_now >= 1 AND ABS((l.price_now - m.price_1m) / NULLIF(m.price_1m,0) * 100) <= 100
ORDER BY pct_change_1m DESC
LIMIT 20;

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

SymbolNameSectorPrice1m change
NANEXA.ST Nanexa AB (publ) Healthcare 9.96 67.11
INTC Intel Corporation Technology 120.17 35.07
AMD Advanced Micro Devices, Inc. Technology 614.72 33.75
ZAP.OL Zaptec ASA Industrials 64 30.21
GME GameStop Corp. Consumer Cyclical 24.22 28.76
YUBICO.ST Yubico AB Technology 113.70 28.62
SIVE.ST Sivers Semiconductors AB (publ) Technology 31.38 27.46
2020.OL 2020 Bulkers Ltd. Industrials 5.81 26.97
MSTR Strategy Inc Technology 158.24 26.72
BRAIN.ST BrainCool AB (publ) Healthcare 1.09 26.24
META Meta Platforms, Inc. Communication Services 727.53 25.75
LYKO-A.ST Lyko Group AB (publ) Consumer Defensive 102 22.16
IMP-A-SDB.ST Implantica AG Healthcare 73.80 21.58
EMBRAC-B.ST Embracer Group AB (publ) Communication Services 88.16 20.34
EGTX.ST Egetis Therapeutics AB (publ) Healthcare 9.44 19.65

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