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 cost, the N largest single day gains in SPY are replaced with zero modeling an investor who was not invested on those exact days. The total return is then compared to staying fully invested throughout the entire time.
Out of roughly 1,260 trading days in five years, fewer than 25 carry a majority of the return.
Nobody can predict which days those will be in advance. They look like ordinary days until the market opens.
Anyone trying to time the market runs the risk of missing these exact days. The penalty for being out of the market then is huge.
Eight stocks, equal-weighted, held over the same window:
META, NVDA, AMZN, MSFT, LLY, V, BRK-B, KO
| Series | Total return | Annualized | Annual volatility | Maximum drawdown | Sharpe ratio |
|---|---|---|---|---|---|
| Portfolio | 286.9% | 30.7% | 23.6% | -28.5% | 1.30 |
| SPY | 90.2% | 13.5% | 17.0% | -24.5% | 0.80 |
Volatility = how much the value bounces around. Drawdown = the biggest drop from a peak. Sharpe ratio = return per unit of risk taken (higher is better).
The 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. In real life, most retail investors sell during steep drawdowns and miss the recovery.
Two findings, pointing the same direction:
The data supports long term investing in a broad spectrum of stocks 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.
Phillip Vogt
Baylor University