Asset Allocation Before Retirement

We know that reducing risk just before and just after retirement is a good idea, but in practice that leaves many questions unanswered. How long before retirement should we dial down risk (de-risk)? What amount of “safe” investment is best? And what is the cost likely to be in terms of returns from having a lower risk portfolio?