How much do you lose by missing the best days of the stock market?

"" shows how missing the best days of the stock market can significantly decrease your investment.

Example: Assume that on 1990-01-01, you invest a lump sum into the stock market. (1990-01-01 was New Year's Day, and the stock market was closed, so assume that you invest on the next market day.) In the next 15 years, you stay invested, except that you miss some best days of the stock market. How much do you lose, as a percentage, if you define 100% to be what you would have, if you were to miss zero best days?

See the table below. See the row with "15" in the column "Years":


 * If you miss 0 best days, you lose 0%.
 * If you miss the 1 best day, you lose 5%.
 * If you miss the 2 best days, you lose 10%.
 * If you miss the 3 best days, you lose 15%.
 * If you miss the 4 best days, you lose 19%.
 * If you miss the 5 best days, you lose 23%.

Problem
Stated more precisely:


 * Assume that you invest a lump sum into the stock market, from some start date to some end date.
 * Assume that you stay invested, except that you miss some number of best days.
 * Assume that you reinvest dividends. Use the following stock index: Standard & Poor's 500 Total Return. This was used by other organizations who did work similar to ours. You can download this index at, for example, Yahoo Finance, which has data from 1988-01-05.
 * Temporarily imagine that you miss zero best days. The final value of your investment---consider it as "100%."
 * What percent of your investment do you lose by missing the best days?

The above problem is somewhat not realistic, in that it assumes that you miss only the best days:


 * If you invest into the stock market over many years, and miss a few days, there is a low probability that these days are the best days. Consider the following example. Assume that you invest for 5 years into the stock market. Assume that you (randomly) miss 2 days. What is the probability that these 2 days are the 2 best days? A year might have around 260 market days. So the number of 2-combinations is around $${5 \times 260 \choose 2} = {1300 \choose 2} = 1300 \times 1299 / 2 = 844,350$$. So the probability that the 2 missed days are the 2 best days is around $$1/844,350$$, which is around zero.


 * On 2019-02-08, the financial blog The Irrelevant Investor had an article called Miss the Worst Days, Miss the Best Days, by Michael Batnick. He considered the S&P 500 Total Return from 1990 to 2019. He wrote, "The best days often follow the worst days, and the worst days occur in periods of above average volatility (red dotted line). These volatility spikes happen in lousy markets, so, if you can avoid the very best days, you will probably also avoid the very worst days, thereby avoiding lousy markets."

Although the above problem is somewhat not realistic, considering it may be beneficial:


 * Other organizations considered a similar problem. Later, we discuss their results.
 * Other organizations and we have a common result: missing the best days of the stock market can significantly decrease your investment, as we had mentioned in the introduction.
 * This common result is similar to the following research, which we could paraphrase as: missing the best stocks can significantly decrease your investment.
 * "[T]he best-performing 4% of listed companies explain the net gain for the entire US stock market since 1926, as other stocks collectively matched Treasury bills." This statement is from the abstract of the paper Do stocks outperform Treasury bills?, by Hendrik Bessembinder, Journal of Financial Economics, volume 129, issue 3, pages 440-457, 2018-09-01.
 * This common result agrees with some advice and research about buying and holding investments, which we state or paraphrase below:
 * Stay the course.
 * Set it and forget it.
 * Don't do something! Just stand there!
 * Time in the market beats timing the market.
 * Don't look for the needle. Buy the haystack. (This advice says to buy the total stock market, but we could interpret it as saying to be invested in all market days.)
 * "Of 66,465 households with accounts at a large discount broker during 1991 to 1996, those that trade most earn an annual return of 11.4 percent, while the market returns 17.9 percent." This statement is from the abstract of the paper Trading Is Hazardous to Your Wealth: The Common Stock Investment Performance of Individual Investors, by Brad M. Barber and Terrance Odean, The Journal of Finance, volume 55, number 2, pages 773--806, 2000-04-01.

Similar work by others
Below, we discuss similar work by other organizations, who solved the following problem: How does $10,000 grow if you miss the best days of the stock market? Other organizations calculated dollar amounts, which we express as percent losses.

Miss the best days from 1991 to 2015, a range of 25 years
The financial company Foresters Financial calculated the following dollar amounts, which we express as percent losses.

Note (*): Possibly Foresters Financial had a typo, switching two digits---$68,691 should be $68,961.

Miss the best days from 1995 to 2014, a range of 20 years
The financial company J. P. Morgan calculated the following dollar amounts, which we express as percent losses.

Note (*): Possibly these values should be $65,475; $32,676; $20,361; $13,451; $9,143; $6,394; $4,571. Possibly J. P. Morgan used assumptions which were different from ours. Or possibly they made a mistake. Or possibly we made a mistake.

Miss the best days from 1999 to 2018, a range of 20 years
On 2019-04-11, the financial web site The Motley Fool had an article called What Happens When You Miss the Best Days in the Stock Market?, by Michael Aloi. He had results from the financial company J. P. Morgan, who calculated the following dollar amounts, which we express as percent losses.

Miss the best days from 2000 to 2019, a range of 20 years
On 2020-12-31, the financial web site The Motley Fool had an articled called Missing Just a Few of the Best Stock Market Days Could Cost You Big, by Diane Mtetwa. She had results from the financial company J. P. Morgan, who calculated the following dollar amounts, which we express as percent losses.

Note (*): Possibly The Motley Fool or J. P. Morgan had a typo, switching two digits---$10,176 should be $10,167.

Miss the best days from 2002 to 2021, a range of 20 years
On 2022-03-25, the financial company J. P. Morgan had an article called Is market timing worth it during periods of intense volatility?, by Jack Manley. The company calculated the following dollar amounts, which we express as percent losses.

Miss the best days from 2004 to 2019, a range of 15 years
On 2020-04-03, the financial web site PortfolioWise had an article called The Best Days and the Worst Days, by Carlton Neel. He had results from the financial company Putnam Investments, who calculated the following dollar amounts, which we express as percent losses.

Note (*): Possibly these values should be $36,369; $18,333; $11,892; $8,139; $5,839; Possibly Putnam Investments used assumptions which were different from ours. Or possibly they made a mistake. Or possibly we made a mistake.

Miss the best days from 2005 to 2020, a range of 15 years
On 2022-01-24, the financial publisher Banyan Hill had an articled called 10 days to never miss in the stock market, by Charles Mizrahi. The company calculated the following dollar amounts, which we express as percent losses.

Miss the best days from 2006 to 2021, a range of 15 years
On an unspecified date, the financial company Putnam Investments had an article called Staying invested even when markets are volatile can serve investors well, by unspecified authors. The company calculated the following dollar amounts, which we express as percent losses.

A formula for how much you lose if you miss some days of the stock market
This section may be skipped.

This section generalizes previous sections. The main result is a formula for how much you lose if you miss some days of the stock market. Use the following assumptions:


 * You invest into the stock market on a set of market days.
 * The set is not empty.
 * The market days do not need to be consecutive.
 * You miss a subset of market days.
 * The subset can be empty.
 * The subset is not all market days.
 * The missed market days do not need to be consecutive.
 * The missed market days can be the best, the worst, in between, or any combination of these possibilities.
 * We use other assumptions or definitions which might not be conventional.

This section is related to previous sections as follows:


 * Previous sections have dollar amounts. If we ignore any mistakes in the dollar amounts, then the dollar amounts are the products of three things: the initial investment, the "total return," and the "relative return."
 * Previous sections have percent losses. These are "relative losses" and can be calculated as one minus a "relative return."

Assumption about the (daily) return: The (daily) return of a market day is its close, divided by the close of the previous market day.

Assumption about the (total) return: The (total) return of a set of market days is the product of the (daily) returns.

Theorem about the (total) return if the market days are consecutive: Assume that the market days are consecutive. Then the (total) return is the close of the last market day, divided by the close of the market day before the first market day.

Proof: The (total) return is the product of the (daily) returns, each of which is a fraction. There are two cases. If there is one market day, then the statement is true. If there is more than one market day, then for the second fraction and later fractions, the denominator equals the numerator of the previous fraction. This situation results in cancelation. We are left with the denominator of the first fraction and the numerator of the last fraction. The statement is true.

Definition of the "relative return": The "relative return" is the (total) return of the non-missed market days, divided by the (total) return of all market days.

Theorem about when the "relative return" is 100%: If you miss zero days, the "relative" return is 100%.

Example about when the "relative return" is more than 100%: This situation might seem paradoxical. But it can happen when the stock market is decreasing. Assume that you invest for two consecutive market days, whose (daily) returns are 90% and 80%, respectively. Assume that you miss the first market day. The "relative return" is $$0.80 / (0.90 \times 0.80) = 1/0.90 > 1 = 100%$$.

Theorem about a formula for the "relative return": The "relative return" is one divided by the (total) return of the missed market days.

Proof: A "relative return" is a fraction. The numerator is a product of the (daily) returns of non-missed market days. The denominator is a product of the (daily) returns of all market days. All terms in the numerator cancel with identical terms in the denominator. The new numerator is one. The new denominator is the product of the (daily) returns of the missed market days.

Definition of the "relative loss": The "relative loss" is one minus the "relative return."

Theorem about a formula for the "relative loss": The "relative loss" is one minus the fraction of one divided by the (total) return of the missed market days.

Algorithms to calculate how much you lose if you miss the best days of the stock market
This section may be skipped.

We describe algorithms to calculate how much you lose if you miss the best days of the stock market. Also, we calculate the time complexity of the algorithms. There may exist better algorithms. Use the following notation and assumptions:


 * Let $$D$$ be the number of market days in an input file.
 * Let $$D > 0$$.
 * Let $$B$$ be the number of best market days to miss.
 * Let $$0 < B < D$$.
 * Possibly often, $$B$$ is much less than $$D$$.
 * View $$B$$ as a constant. Doing so simplifies the calculation of the time complexity.

We describe two algorithms:


 * The two algorithms have similar steps at the start and end.
 * Algorithm 1 considers one end date.
 * Input: market days, start date, end date, and number of best market days to miss.
 * Output: A number: How much you lose if you miss the best market days from the start date to the end date.
 * Time complexity: $$O(D \log D)$$.
 * Algorithm 2 generalizes Algorithm 1. Algorithm 2 considers various end dates.
 * Input: Same as Algorithm 1, except that we do not use an end date.
 * Output: A list of numbers, indexed starting with 1, such that the value at index $$d$$ is how much you lose if you miss the best market days, in the first $$d$$ market days.
 * Time complexity: $$O(D \log D)$$. However, we can decrease this to $$O(D)$$, if we assume that the input file has sorted the market days from early to recent. If the input file has the market days in reverse, then, we can reverse them in $$O(D)$$ time. Consequently, the time complexity does not change.