Image source: Getty Images.

As you get close to your retirement, one 10-year span matters more to your success than any other. That span starts five years before you retire and runs through five years after you call it quits. That 10-year window is critical because it plays a huge part in determining both how much you'll have available to spend in your retirement and how likely it is that your nest egg will last as long as you do.

In the five years before you retire, you'll want to set yourself up so that you'll be able to take withdrawals once you retire, without putting the money you need to spend at unnecessary risk. In the five years after you retire, you'll want to balance your need for money to spend on your costs of living with your need for money to invest to support the later years of your retirement. If you handle both five-year periods well, you'll set yourself up well for success throughout the rest of your retirement.

What happens if you get it wrong?

To illustrate why those years are so critical, imagine someone who made some serious money during the late 1990s technology boom and decided to retire on January 1, 2000. This retiree, not knowing any better, decided to stick with what had worked so well and retired with a portfolio made up of the tech titans that created that paper fortune.

Assume that person had a $1 million portfolio entirely invested in the PowerShares QQQ (QQQ -0.57%) Exchange traded fund made up of 100 of the largest non-financial NASDAQ-traded companies. Thanks to that design, the PowerShares QQQ ETF represents a technology-heavy investment.

In those heady days, many people had a mistaken belief that stocks -- particularly tech stocks -- could only go up. If that retiree thought the tech boom would never end and stayed invested in the PowerShares QQQ ETF, the chart below shows what could have happened to that retiree's portfolio over the next decade:

Date

Portfolio Starting Value

Action

Withdrawal

Portfolio Ending Value

1/1/2000

$1,000,000

Take out spending cash

$40,000

$960,000

1/1/2001

$613,297

Take out spending cash

$41,138

$572,159

1/1/2002

$381,374

Take out spending cash

$41,789

$339,585

1/1/2003

$212,688

Take out spending cash

$42,741

$169,947

1/1/2004

$254,357

Take out spending cash

$43,879

$210,478

1/1/2005

$232,665

Take out spending cash

$45,366

$187,299

1/1/2006

$190,234

Take out spending cash

$46,829

$143,405

1/1/2007

$153,650

Take out spending cash

$48,163

$105,486

1/1/2008

$125,555

Take out spending cash

$50,012

$75,542

1/1/2009

$44,019

Take out spending cash

$49,834

($5,815)

Data sources: ETF data from Yahoo! Finance and inflation data from the U.S. Bureau of Labor Statistics. Assumes no friction costs and that all dividend/gains distributions are reinvested. 

While the PowerShares QQQ ETF did eventually top the price it saw late in the tech boom, it was too little, too late for our retiree friend, who ran out of cash within nine years of retiring. The key difference between a retiree and a working investor is the fact that most retirees need to take out cash to cover living costs, while a working investor has a job to cover those daily costs of living.

It's not as though our hypothetical retiree was being unreasonable with that initial withdrawal plan. The chart above starts with a $40,000 withdrawal from a $1,000,000 portfolio and increases the withdrawals for inflation each year. Those guideposts are key parts of a common retirement guideline known as the 4% rule. The key difference is that the standard 4% rule presumes the investor starts with a diversified stock- and bond-based portfolio, while our unfortunate retiree was 100% invested in stocks.

How to use those 10 years to your advantage

The key to your ultimate success in retirement is having a source of spending cash that has a high likelihood of actually being there for you when you need it. A key guideline for any investor wanting to avoid the scenario described above is to not have any money in stocks that you expect to spend within the next five or so years.

As a result, beginning at least five years before you retire, you need to start converting some of your money from stocks to bonds. How much? Enough so that when you do retire, you have sufficient cash to cover your spending needs. A common way to do that with bonds is via a strategy known as a "bond ladder."

Since bonds eventually mature and pay back their face value as cash, investors creating a bond ladder would buy bonds that mature on a regular cycle, so they'll have cash available when they need it. If you buy investment-grade bonds that mature in five years about five years before your retirement, when it comes time to retire, you'll have cash from those maturing bonds.

To turn that tactic into a bond ladder, when you're four years before retirement, convert another year's worth of living expenses into five-year investment-grade bonds. In so doing, your original set of bonds will have four years until maturity. Repeat the process every year, up until just before you retire.

At that point, you'll have a year's worth of spending cash coming in from your maturing bonds, plus another five years' worth of spending cash coming in when those other investment-grade bonds mature. The rest of your portfolio can stay in stocks, and you'll be much better equipped to handle the ups and downs of the stock market, simply because you won't have to sell your stocks to cover your immediate costs of living.

Keep it up throughout your retirement

By following this strategy, you set yourself up to have a very strong likelihood of success during those critically important 10 years of your retirement plan. Even better, it's a strategy you can keep up throughout your retirement.

If the market performs as expected, you can keep converting your stocks to bonds each year to keep your bond ladder going strong. If the market performs exceptionally well, you can extend your bond ladder to give you an even greater buffer. And if the market performs poorly, you're under no immediate obligation to sell your stocks to cover your costs of living, and you can let that bond ladder shrink a bit.

If you do have to shrink your bond ladder because of a poor market, just be sure to build back toward that target of at least five years in your bond ladder over time. That way, you retain the flexibility to not have to sell your stocks in a bad market just to cover your costs of living. When all is said and done, that's one of the most important things you can do as a retiree to improve your chances of seeing your nest egg last as long as your retirement does.