Calculations › Market Risk

Show the top 10 most volatile stocks in the market, last 30 days

The query

-- barchart market-wide: top 10 most volatile stocks (stddev of daily % return, 30d)
WITH recent AS (
  SELECT tp.ticketnameid, tp.price,
         LAG(tp.price) OVER (PARTITION BY tp.ticketnameid ORDER BY tp.datetime) AS prev_price
  FROM ticketprice tp JOIN ticketname tn ON tn.id = tp.ticketnameid
  WHERE tn.tickettype = 'stock' AND tp.price >= 1
    AND tp.datetime >= EXTRACT(EPOCH FROM (NOW() - INTERVAL '30 days'))::bigint
)
SELECT tn.ticket AS symbol, STDDEV((r.price - r.prev_price) / NULLIF(r.prev_price,0) * 100) AS volatility
FROM recent r JOIN ticketname tn ON tn.id = r.ticketnameid
WHERE r.prev_price IS NOT NULL
GROUP BY tn.ticket
HAVING COUNT(*) >= 15
ORDER BY volatility DESC
LIMIT 10;

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

SymbolVolatility
SUMMAS.ST 30.44
2020.OL 25.28
NANEXA.ST 23.58
IMPC.ST 11.16
HFRTO-B.ST 9.67
SBB-D.ST 8.42
PSNY 7.09
GIGA.ST 7.00
ONCO.ST 6.88
SIVE.ST 6.44

Live output, first 10 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