In uncertain times, many investors want to hedge their bets. Even if you have money to invest, it's natural to wonder whether you ought to be putting a big chunk of cash into the market right now, versus waiting and potentially scoring a bigger bargain in the near future.

One strategy, dollar-cost averaging, is designed to try to give you the best of both worlds. But dollar-cost averaging has its downsides as well. So if you're saving money regularly to invest, what's the best strategy to follow?

Answering the big question
That's what @natemcgraw asked the Fool on our Twitter feed: "Better to dollar cost average with monthly (or so) buys or to save up for a bigger buy when you think the price is right?"

Before tackling the question, let's quickly review what dollar-cost averaging is. Rather than taking a big lump sum and investing it all at once, dollar-cost averaging involves breaking that lump sum into several equal pieces, investing each piece one by one at regular intervals.

The strategy has two advantages over simply making a one-time investment. First, it protects you from having extremely bad timing with your purchase. If the market drops immediately after your first buy, you still have all the other pieces left to invest in the future. Second, if prices do fall, dollar-cost averaging benefits you; by investing the same dollar amount each time, you'll buy a greater number of shares when the cost per share drops.

Some investors have questioned whether dollar-cost averaging really makes sense, though. Historically, the stock market has trended up more often than down, and so you'd often have been better off simply putting your entire investment at the outset, rather than parceling it out.

A simple rule
Since there's no way to predict exactly whether a stock will rise or fall in the short run, coming up with an answer that universally works isn't possible. But one simple rule gives you a good starting point:

Use dollar-cost averaging if the stock you like has an above-average valuation. Buy shares all at once if the stock is undervalued.

To see how this works, let's take a couple of examples.

In the summer of 2008, commodity stocks had risen sharply. Prices of everything from oil and precious metals to foodstuffs and basic materials had jumped to all-time highs, and stocks in those industries performed extremely well. Fertilizer stocks PotashCorp (NYSE: POT) and Mosaic (NYSE: MOS) seemed poised for huge future growth, and Freeport-McMoRan Copper & Gold (NYSE: FCX) and BHP Billiton (NYSE: BHP) were among the many mining companies whose shares skyrocketed as worldwide demand for copper and other base metals went through the roof.

After such strong moves, you might have inferred that shares were valued fairly richly. With prices counting on near-perfection, you might have turned to dollar-cost averaging to protect yourself. As it turned out, that would've been the right move, substantially reducing your losses from what proved to be the worst timing possible.

Stock

Gain/(Loss) With Lump-Sum

Gain/(Loss) With 6-Month Dollar-Cost Averaging

PotashCorp

(73%)

(48%)

Mosaic

(79%)

(51%)

Freeport-McMoRan

(79%)

(50%)

BHP Billiton

(52%)

(27%)

Source: Yahoo! Finance. Returns are for period from June 2008 to November 2008.

In contrast, by early 2009, values abounded in the market. The victims weren't just speculative stocks like Las Vegas Sands and Sirius XM; even blue chips were bid down to extreme lows. Coca-Cola (NYSE: KO) saw the same low valuation that had enticed Warren Buffett to buy the stock 20 years before. Procter & Gamble (NYSE: PG) and Intel (Nasdaq: INTC) also suffered big losses, despite selling products that enjoy constant demand among consumers.

With stocks at good values, you should have been inclined to get your money in as quickly as possible. Again, that turned out to be the right thing to do:

Stock

Gain/(Loss) With Lump-Sum

Gain/(Loss) With Dollar-Cost Averaging

Coca-Cola

12%

4%

Procter & Gamble

17%

6%

Intel

37%

21%

Source: Yahoo! Finance. Returns are for period from March 2009 to August 2009.

Know what's coming
Of course, you won't always have perfect timing. Value stocks can go still lower, and high-priced stocks can keep rising.

But over time, using this mixed strategy should lead to better results than an all-or-nothing approach. That way, you can still bet big on your best investing ideas while maintaining a more conservative stance on stocks that have more risk.

Nothing's smarter than buying great stocks when they're inexpensive. Matt Koppenheffer knows about five stocks that are cheaper than you think.