You may be looking at your portfolio's performance over the past eight months or so and scratching your head, wondering when the pain will end. But when you are investing for retirement or some other goal down the road, it is imperative to understand the power of a long-term investment strategy.

There have been 27 bear markets since 1929, with a bear market defined as the market declining 20% or more during a specific time period. There have also been 27 bull markets since 1929, and they last much longer -- about 2.7 years on average compared to less than 10 months for bear markets.

Furthermore, stocks lose on average about 36% during bear markets and gain 114% during bull markets. So this just shows that the odds are in your favor over the long run. Also, bear markets are typically a good time to buy, as you can invest in high-quality, established growth companies at discounted prices. With that in mind, let's take a look at how a $10,000 investment right now could turn into more than $300,000 over time.

There have been five bear markets in the past 20 years

For the purpose of this hypothetical, let's go back 20 years and see how much a $10,000 investment in the Nasdaq 100 would have yielded. In that time, there have been five bear markets -- in 2002, 2008, 2009, 2020, and 2022.

The Nasdaq 100 is a growth-oriented index that includes the 100 largest stocks on the Nasdaq exchange, except financial stocks. The index is heavily skewed toward technology stocks -- since they have generally been the largest and fastest growing -- and is often considered a bellwether for the performance of the technology sector.

The Nasdaq 100 would be a great index to invest in, because growth stocks have outperformed value stocks over the long term, and technology stocks in particular have been the best-performing sector over time. With a long time horizon ahead of you, you can ride out bear markets and generate excellent returns.

The best way to tap into the Nasdaq 100 would be through an exchange-traded fund (ETF). And one of the most popular ETFs over the past 20 years is the Invesco QQQ (QQQ -1.09%), which tracks the Nasdaq 100.

So back to our hypothetical -- if you'd invested $10,000 in the QQQ back on July 22, 2002, you would have invested in the middle of a bear market -- one that didn't end until Oct. 2002. Sound familiar?

Through it all, a $10,000 investment would net $300,000

From July 22, 2002, until today, the QQQ has posted an annualized return of 13.6%. If you'd invested $10,000 in the QQQ 20 years ago, and contributed $125 per month to that fund, you would have about $303,000 right now.

Keep in mind, that performance is through five bear markets, including the one we are currently in. This preceding 20-year period is particularly relevant now, because the investment would have started in the midst of a bear market.

Now, you know the disclaimer: Past performance is not indicative of future results, and there is no guarantee that an investment in the Nasdaq 100 will return 13.6% over the next 20 years. But history is indeed a useful guide to understand that volatility and down markets are a fact of life -- and patience has typically been rewarded.