Market Timing and Stock Picking

Two ways investors try to beat the S&P 500, tested with tidyquant

Phillip Vogt

2026-04-01

Two ways people try to beat the market

  1. Market timing: moving in and out at the “right” moments.
  2. Stock picking: holding a small group of stocks you believe in.

Both are tested here against the S&P 500 from April 2021 to April 2026.

Data and methods

Daily stock prices are pulled with tidyquant, an R package built around Yahoo Finance.

library(tidyquant)

prices <- tq_get("SPY",
                 from = "2021-04-01",
                 to   = Sys.Date())

Test 1: The cost of missing the wrong days

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.

Test 1: A few days carry most of the return

Test 1: What this means

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.

Test 2: A “what I’d actually buy” portfolio

Eight stocks, equal-weighted, held over the same window:

META, NVDA, AMZN, MSFT, LLY, V, BRK-B, KO

Test 2: Did the picks beat the market on returns?

Test 2: But how rough was the ride?

Test 2: The numbers side by side

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).

Test 2: What this means

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.

Conclusions

Two findings, pointing the same direction:

  1. Timing is key. The market’s best days can’t be predicted, and missing them destroys returns.
  2. Picking can outperform at a cost. Higher returns come with much higher risk.

The data supports long term investing in a broad spectrum of stocks over trying to outsmart the market.

References

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