Two ways investors try to beat the S&P 500, tested with tidyquant
2026-04-01
Both are tested here against the S&P 500 from April 2021 to April 2026.
Daily stock prices are pulled with tidyquant, an R package built around Yahoo Finance.
What if an investor missed only the market’s biggest up days?
To measure this, the number (N) of largest single day gains in SPY are replaced with zero modeling an investor who was not invested at all during those exact days. The total return is then compared to staying fully invested.
Out of roughly 1,260 trading days in five years, fewer than 25 carry most of the return.
Anyone trying to time the market runs the risk of missing these days. The penalty for being out of the market then is huge.
Eight stocks, all held over the same window:
META, NVDA, AMZN, MSFT, LLY, V, BRK-B, KO
The personal portfolio beat SPY on total return but only because it stayed invested through a much steeper drop in 2022.
Higher returns came with much higher risk. Most retail investors sell during big drops and miss the recovery.
Two main findings:
The data supports long term investing in a broad index over trying to outsmart the market.
Dancho, M. (2024). tidyquant: Tidy Quantitative Financial Analysis. R package version 1.0.7. CRAN.
Dancho, M. (2024). Core Functions in tidyquant [package vignette]. CRAN.
Dancho, M. (2024). Performance Analysis with tidyquant [package vignette]. CRAN.
Price data accessed via Yahoo Finance through tq_get() at render time.
https://github.com/Phvogt3/tidyquant-lightning-talk
Phillip Vogt
Baylor University