When you’re investing for retirement, your main task is to establish a long-term goal and plot out a portfolio that will get you there. But it’s also crucial to be on guard against major disasters. One of the most critical impediments you need to be wary of: running into a bear market just as you’re about to retire.