STRASMORE/EXPLORE 2,173 QUERIES 22Y EQUITIES · 12Y OPTIONS

2,173 answered market questions

every one with its exact SQL, its result and the date it was computed · free, no signup

Look-Ahead Bias: The Backtest Killer
Survivorship in the universe: names trading each year, share still listed in July 2026, and median returntable · 2026-07-31 · 10×6 Same-bar decision vs a one-session lag: SPY, average session gain, 2016-2025table · 2026-07-31 · 10×5 The hindsight ceiling: SPY buy and hold, the same year without its biggest up days, and perfect one-day foresighttable · 2026-07-31 · 10×5
Survivorship in the universe: names trading each year, share still listed in July 2026, and median return

Survivorship in the universe: names trading each year, share still listed in July 2026, and median return

most recentas of table 10×6read in context →
Survivorship in the universe: names trading each year, share still listed in July 2026, and median return — 10 rows by 6 columns, computed from US exchange, SIP and OPRA data.
yearnames_tradingstill_listed_pctmedian_return_all_pctmedian_return_survivors_pctsurvivor_gap_pp
2015706352.5-5.39-5.290.09
2016700955.47.6510.853.2
2017709257.77.5111.323.81
2018724561.1-13.67-13.030.64
2019760563.414.117.042.94
2020774567.91.062.741.68
2021850669.16.8810.473.59
2022921773.5-20.26-19.950.31
2023901380.84.655.781.13
2024925787.52.242.90.66
the exact SQL behind every number
WITH recent AS (
    SELECT DISTINCT ticker
    FROM global_markets.stocks_daily_aggs
    WHERE date >= toDate('2026-06-15')
      AND date <= toDate('2026-07-28')
),
per_name AS (
    SELECT toYear(date) AS year,
           ticker,
           argMin(toFloat64(close), date) AS first_close,
           argMax(toFloat64(close), date) AS last_close,
           count() AS sessions
    FROM global_markets.stocks_daily_aggs
    WHERE date >= toDate('2015-01-01')
      AND date <= toDate('2024-12-31')
      AND close > 1
    GROUP BY year, ticker
    HAVING sessions >= 200
)
SELECT year,
       uniqExact(ticker) AS names_trading,
       round(100 * uniqExactIf(ticker, ticker IN (SELECT ticker FROM recent)) / uniqExact(ticker), 1) AS still_listed_pct,
       round(100 * quantileDeterministic(0.5)(last_close / first_close - 1, cityHash64(ticker)), 2) AS median_return_all_pct,
       round(100 * quantileDeterministicIf(0.5)(last_close / first_close - 1, cityHash64(ticker), ticker IN (SELECT ticker FROM recent)), 2) AS median_return_survivors_pct,
       round(100 * (quantileDeterministicIf(0.5)(last_close / first_close - 1, cityHash64(ticker), ticker IN (SELECT ticker FROM recent))
                    - quantileDeterministic(0.5)(last_close / first_close - 1, cityHash64(ticker))), 2) AS survivor_gap_pp
FROM per_name
GROUP BY year
ORDER BY year
$