The past seven months have been a wild ride for stocks. In March, the market crashed as a result of the coronavirus outbreak. Then, stocks recovered, only to encounter a major sell-off in early September. In fact, the stock market has bounced around a lot in October, and as we inch closer and closer to the upcoming presidential election, we could see even more turbulence. As an investor, that puts you in a tough spot, so if you're worried about managing your portfolio during these trying times, here's one solution worth considering: dollar-cost averaging. It's a strategy that investing legend Warren Buffett has long advocated, and it's a good bet for navigating a volatile market like the one we're in. Image source: Getty Images. How dollar-cost averaging works The concept of dollar-cost averaging is simple: Pick some stocks, figure out how much you can afford to invest, and then commit to buying shares at preset intervals. For example, say you decide you want to buy Netflix (NASDAQ: NFLX) and can dedicate $200 every two weeks toward its shares. (Technically, $200 isn't enough to buy a full share of Netflix right now, but you can buy fractional shares instead.) In that case, you'd buy Netflix every other week, regardless of the price it's trading at on the day you purchase your shares. The idea behind dollar-cost averaging is that while you might overpay for shares some weeks, you'll also underpay other weeks. All told, things should all work out in your favor so that you're ultimately paying a lower price per share all in. Dollar-cost averaging is a far safer bet than aiming to time the market during periods of volatility, because in doing so, you might miss out on great buying opportunities and risk getting stuck with a higher share price overall. Remember, the stock market is unpredictable on a good week, but when we're in the midst of election season, it can be even wilder. And at a time like that, being consistent is crucial. Of course, if you want to take Buffett's advice even further, employ dollar-cost averaging to buy shares of S&P 500 index funds. That way, you get exposure to the broader market and aren't putting all of your money into a single stock. Buffett has stated many times over that index funds are a great way for the average investor to grow wealth, so if you don't want to do the legwork involved in vetting individual stocks, index funds are the way to go. Take Buffett's advice A man with the investing track record of Buffett is someone to take seriously. If you're looking to invest in the coming weeks, it pays to employ dollar-cost averaging rather than attempt to time the market in an effort to score the lowest stock prices. Investors who try timing the market often get burned, and given the way stocks could swing in the near term, a stable, steady approach is not only a safer bet, but most likely a more lucrative one as well. 10 stocks we like better than NetflixWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the ten best stocks for investors to buy right now... and Netflix wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of October 20, 2020 Maurie Backman owns shares of Netflix. The Motley Fool owns shares of and recommends Netflix. The Motley Fool has a disclosure policy.Source