Bank Of America FrontI've been a pretty vocal supporter of dollar-cost averaging, as I truly believe that it's an excellent way to build a portfolio over the long run and protect yourself from bumps in the road. One comment I've received several times from worried readers is, "What about when stocks crash? Is dollar-cost averaging still a good strategy?"

Here's an example of a stock that crashed pretty hard several years ago, Bank of America (NYSE:BAC), which I feel illustrates the power of this strategy.

What is dollar-cost averaging?
Dollar-cost averaging is an investment strategy that involves accumulating a position in a stock over a long period of time. Specifically, it involves investing equal dollar amounts at set intervals in order to produce a favorable average price, no matter what the stock does.

As a basic example, let's say you want to invest $2,000 in a stock. It's trading for $40 now, so you decide to invest half of your money, and purchase 25 shares. In one year, the stock's price goes up to $50, so you invest the other $1,000, and buy 20 more shares.

Between the two times you bought shares, the stock's average price was $45. However, since you bought more shares while they were cheaper, your average cost per share is $44.44. Thanks to the laws of mathematics, dollar-cost averaging guarantees you a better-than-average price.

That sounds great when stocks go up and up forever; but what about when the market isn't great? Or worse yet, what about when one of your stocks drops like a rock?

Bank of America: Pre-crisis investment
Let's go back in time 10 years ago to September 2005. If you had been bullish on bank stocks, like many people were at the time, you would have been making one of the worst investment calls possible, as you can see from the chart below.

BAC Chart

If you had bought $10,000 worth of Bank of America stock in September 2005, you would have paid approximately $43 per share for 232 shares. Even if you had reinvested all of the dividends you would have received along the way, you would still be down 54.6% today, leaving you with just $4,540.

The power of dollar-cost averaging
Instead of investing all $10,000 at once, let's see what would have happened if you had bought $1,000 worth of Bank of America every year for 10 years in order to average into your position. Just as in the last example, we'll assume you reinvest all of your dividends. For simplicity, we'll assume that you make all of your purchases on the first trading day of each year.

Year

BAC share price

Shares bought ($1,000)

Dividends paid (TTM)

Shares from dividends

Total shares owned

2006

$46.29

21

   

21

2007

$53.40

19

$2.16

0.8

40.8

2008

$41.53

24

$2.40

2.4

67.2

2009

$13.92

72

$2.24

10.8

150

2010

$15.24

66

$0.04

0.4

216.4

2011

$13.85

72

$0.04

0.6

289

2012

$5.75

174

$0.04

2.0

465

2013

$12.05

83

$0.04

1.5

549.6

2014

$15.69

64

$0.04

1.4

615

2015

$17.99

56

$0.12

4.1

675.1

Ending value (9/2/2015)

$15.73

 

 

 

$10,619.36

Wait a second. Wouldn't it have been better to have purchased all of your shares in 2012? Well, sure, but trying to time the market is always a bad idea. There's no way you could have known that 2012 was going to be the bottom, nor did you know that 2007 would have been the high point.

Dollar-cost averaging takes away the need to worry about what the market will do next. Could Bank of America fall to $10 per share next year? Absolutely -- and it would just give us another opportunity to get our average down.

Our averaging strategy would have produced a 6.2% total return, which is a pretty poor return during 10 years. However, when compared with the stock's negative 54.6% total return during the past 10 years, it's a no-brainer. In other words, by averaging into Bank of America, you would have beaten the stock's performance by nearly 61%.

It's still important to diversify
This is just one example that illustrates the power of both dollar-cost averaging and dividend reinvestment. However, bear in mind that some investors weren't so lucky. During the financial crisis, it didn't matter how good of a strategy you used if you invested in Lehman Brothers.

For this reason, it's important to combine your dollar-cost averaging strategy with a properly diversified portfolio strategy. Dollar-cost averaging can help you recover from a correction or crash -- not a collapse.

Still, if you're concerned about whether or not now is the right time to buy Bank of America or any other stock you have your eye one, dollar-cost averaging makes the answer a resounding "yes."

Matthew Frankel owns shares of Bank of America. The Motley Fool recommends Bank of America. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.