STRASMORE/EXPLORE 2,170 QUERIES

SPY's 20 best and 20 worst days since 2016, counted by year

Answered against 22 years of US equities and 12 years of US options data and published with the query that produced it. This result is stored as of 2026-07-16, from What Missing the Best Days Costs.

as of ranking 11×3read in context →
SPY's 20 best and 20 worst days since 2016, counted by year — 11 rows by 3 columns, computed from US exchange, SIP and OPRA data.
yearbest_20_daysworst_20_days
201601
201700
201812
201910
2020119
202100
202255
202300
202400
202523
202600
Rows × columns
11 × 3
Computed
Completeness
No missing values
Source
US exchange, SIP and OPRA market data
Licence
Strasmore terms · free, no signup
Formats
JSON · CSV · the SQL below

What each column holds

Column definitions for SPY's 20 best and 20 worst days since 2016, counted by year, derived from the stored result.
ColumnTypeRangeNotes
year number 2,016 to 2,026
best_20_days number 0 to 11
worst_20_days number 0 to 9

Computed from Strasmore's warehouse of US exchange, SIP and OPRA market data. Equity prices are delayed; options greeks and implied volatility are end-of-day. This result is stored, not recomputed on load — it is exactly the numbers that were returned on , and the query below is what returned them.

the exact SQL behind every number
WITH daily AS (
    SELECT toDate(toTimeZone(window_start, 'America/New_York')) AS dt,
           argMax(toFloat64(close), toTimeZone(window_start, 'America/New_York')) AS c
    FROM global_markets.delayed_stocks_minute_aggs
    WHERE ticker = 'SPY' AND window_start >= '2016-01-01'
      AND (toHour(toTimeZone(window_start, 'America/New_York')) * 60
           + toMinute(toTimeZone(window_start, 'America/New_York'))) BETWEEN 570 AND 959
    GROUP BY dt
),
rets AS (
    SELECT dt, c / lagInFrame(c) OVER (ORDER BY dt) - 1 AS ret FROM daily
),
clean AS (
    SELECT dt, ret FROM rets WHERE ret IS NOT NULL AND ret > -0.5 AND ret < 0.5
),
ranked AS (
    SELECT dt, ret,
           row_number() OVER (ORDER BY ret DESC) AS best_rnk,
           row_number() OVER (ORDER BY ret ASC) AS worst_rnk
    FROM clean
)
SELECT toYear(dt) AS year,
       countIf(best_rnk <= 20) AS best_20_days,
       countIf(worst_rnk <= 20) AS worst_20_days
FROM ranked
GROUP BY year
ORDER BY year

Run your own version of this

The same 22 years of US equities and 12 years of options data are queryable in SQL or plain English. A free account runs 100 queries a day and takes no card.

More from this analysisWhat Missing the Best Days Costs
The ten biggest single-day gains for SPY since 2016 ranking 10×2 SPY total return since 2016, after removing the best single days ranking 5×2 S&P 500 worst intra-year drawdown vs the year's price return, since 2016 ranking 11×3 How far below its high the S&P 500 sits: share of trading days since 2016 ranking 5×2 News sentiment coverage by year: how many tagged insights, and the share downbeat ranking 3×3 The S&P 500's underwater curve: worst drawdown from a prior high, by month series 127×2 See all 2,170 queries →