STRASMORE/EXPLORE 2,170 QUERIES

Same-bar decision vs a one-session lag: SPY, average session gain, 2016-2025

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-31, from Look-Ahead Bias: The Backtest Killer.

as of table 10×5read in context →
Same-bar decision vs a one-session lag: SPY, average session gain, 2016-2025 — 10 rows by 5 columns, computed from US exchange, SIP and OPRA data.
yearsignal_dayssame_bar_avg_pctlagged_avg_pctgap_pp
20161400.447-0.0080.455
20171390.2450.0330.212
20181270.5740.0070.567
20191380.4260.0720.354
20201470.742-0.1650.907
20211370.4850.0390.446
20221270.979-0.0281.007
20231470.5330.0540.479
20241350.4220.0060.416
20251310.636-0.030.666
Rows × columns
10 × 5
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 Same-bar decision vs a one-session lag: SPY, average session gain, 2016-2025, derived from the stored result.
ColumnTypeRangeNotes
year number 2,016 to 2,025
signal_days number 127 to 147
same_bar_avg_pct number 0.245 to 0.979 percent
lagged_avg_pct number -0.165 to 0.072 percent
gap_pp number 0.212 to 1.007

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 bars AS (
    SELECT date,
           toFloat64(open) AS o,
           toFloat64(close) AS c,
           toFloat64(close) > toFloat64(open) AS up_day
    FROM global_markets.stocks_daily_aggs
    WHERE ticker = 'SPY'
      AND date >= toDate('2015-12-01')
      AND date <= toDate('2025-12-31')
),
lagged AS (
    SELECT date, o, c, up_day,
           any(up_day) OVER (ORDER BY date ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS prior_up
    FROM bars
)
SELECT toYear(date) AS year,
       countIf(up_day) AS signal_days,
       round(100 * avgIf(c / o - 1, up_day), 3) AS same_bar_avg_pct,
       round(100 * avgIf(c / o - 1, prior_up), 3) AS lagged_avg_pct,
       round(100 * (avgIf(c / o - 1, up_day) - avgIf(c / o - 1, prior_up)), 3) AS gap_pp
FROM lagged
WHERE date >= toDate('2016-01-01')
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 analysisLook-Ahead Bias: The Backtest Killer
Survivorship in the universe: names trading each year, share still listed in July 2026, and median return table 10×6 The hindsight ceiling: SPY buy and hold, the same year without its biggest up days, and perfect one-day foresight table 10×5 Average S&P 500 tracker return by calendar month, May 2005 through April 2026 table 12×5 Survivors-only average vs whole-cohort average, by starting year table 7×6 SPY holding-period outcomes since 2015: 5th percentile, median, 95th percentile table 4×7 The seasonal gap by era: average half-year returns and the spread between them table 3×6 See all 2,170 queries →