STRASMORE/EXPLORE 2,170 QUERIES

A rolling one year mean return, the number an optimizer would be fed

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-08-16, from When Equal Weight Beats Optimization.

as of series 96×3read in context →
A rolling one year mean return, the number an optimizer would be fed — 96 rows by 3 columns, computed from US exchange, SIP and OPRA data.
monthspy_trailing_mean_pctko_trailing_mean_pct
2017-01-0117.7-0.4
2017-02-0120.7-3.3
2017-03-0116.1-5.9
2017-04-0113.2-5.4
2017-05-0115.2-1
2017-06-0115.91.6
2017-07-0113.60.1
2017-08-0112.35
2017-09-0114.77.7
2017-10-0117.89.6
2017-11-0118.210.8
2017-12-0117.210.8
2018-01-0120.612.6
2018-02-0115.37.5
2018-03-0113.73.8
2018-04-0112.42.8
2018-05-0112.8-3.5
2018-06-0113.1-3.3
2018-07-0113.81.3
2018-08-0115.91.6
2018-09-0116.11
2018-10-019.41.2
2018-11-015.97.9
2018-12-01-2.46.4
2019-01-01-52.6
2019-02-013.16.9
2019-03-014.86.5
2019-04-0110.28.9
2019-05-016.715.7
2019-06-01617.5
2019-07-018.416.9
2019-08-012.916.9
2019-09-014.119.1
2019-10-017.817.5
2019-11-0114.48.8
2019-12-0121.713.2
2020-01-0123.619
2020-02-011823.1
2020-03-01-3.45.6
2020-04-01-0.52.6
2020-05-017.2-2.4
2020-06-0112.4-4.1
2020-07-0112.2-6.6
2020-08-0121.1-6.1
2020-09-0117.4-3.3
2020-10-0119.2-2.4
2020-11-0118.94.3
2020-12-0120.63.9
2021-01-0120.1-6.6
2021-02-0122.2-10.5
2021-03-0142.612.4
2021-04-0142.417.3
2021-05-0137.121.1
2021-06-0132.318.8
2021-07-013220
2021-08-0128.518.3
2021-09-0128.811
2021-10-0127.310.1
2021-11-0128.58.4
2021-12-0124.37.6
2022-01-0119.520.8
2022-02-011421.7
2022-03-0112.517.6
2022-04-016.819.6
2022-05-01-1.617
2022-06-01-6.613.3
2022-07-01-8.913.7
2022-08-01-4.713.8
2022-09-01-12.110.3
2022-10-01-15.46.1
2022-11-01-14.710.8
2022-12-01-14.813.4
2023-01-01-11.73.6
2023-02-01-5.6-0.4
2023-03-01-7.21.4
2023-04-01-4.20.2
2023-05-014.7-0.6
2023-06-0112.5-0.5
2023-07-0116.5-1.2
2023-08-018.5-4
2023-09-0114.4-2.9
2023-10-0115.4-2.6
2023-11-0114.3-4.5
2023-12-0118.6-7
2024-01-0120.6-2.1
2024-02-0121.41.1
2024-03-0127.51
2024-04-0122.4-4.3
2024-05-01240.8
2024-06-0122.84.9
2024-07-0121.46.4
2024-08-0121.414.2
2024-09-0124.922
2024-10-0131.324.3
2024-11-0129.311.1
2024-12-0125.87.5
Rows × columns
96 × 3
Period covered
to
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 A rolling one year mean return, the number an optimizer would be fed, derived from the stored result.
ColumnTypeRangeNotes
month date 2017-01-01 to 2024-12-01
spy_trailing_mean_pct number -15.4 to 42.6 percent
ko_trailing_mean_pct number -10.5 to 24.3 percent

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 prices AS
(
    SELECT
        ticker,
        date,
        toFloat64(max(close)) AS c
    FROM global_markets.stocks_daily_aggs
    WHERE ticker IN ('SPY', 'KO')
      AND date >= '2015-10-01'
      AND date <  '2025-01-01'
    GROUP BY ticker, date
),
rets AS
(
    SELECT
        ticker,
        date,
        c / lagInFrame(c, 1) OVER (PARTITION BY ticker ORDER BY date ASC ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) - 1 AS ret
    FROM prices
),
trailing AS
(
    SELECT
        ticker,
        date,
        avg(ret) OVER (PARTITION BY ticker ORDER BY date ASC ROWS BETWEEN 251 PRECEDING AND CURRENT ROW) * 252 * 100 AS trailing_mean_pct,
        row_number() OVER (PARTITION BY ticker ORDER BY date ASC) AS i
    FROM rets
    WHERE isFinite(ret)
)
SELECT
    toString(toStartOfMonth(date))                     AS month,
    round(avgIf(trailing_mean_pct, ticker = 'SPY'), 1) AS spy_trailing_mean_pct,
    round(avgIf(trailing_mean_pct, ticker = 'KO'), 1)  AS ko_trailing_mean_pct
FROM trailing
WHERE i >= 252
  AND date >= '2017-01-01'
GROUP BY month
ORDER BY month ASC

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 analysisWhen Equal Weight Beats Optimization
Ten years of yearly estimates: the mean moves far more than the volatility ranking 6×3 How far the mean and volatility estimates scatter by sample length ranking 5×4 SPY realised volatility by month against a 10% target series 72×4 Daily at-the-money implied volatility, SPY and NVDA (Apr to Jun 2026) series 62×3 KO quarterly dividend in cents and as a percent of the share price, 2016 to 2026 series 42×4 Where the volume sits: share of June 2026 volume by half hour, New York time series 32×3 See all 2,170 queries →