When the market hits new highs, investors may be tempted to cash out. Historically, remaining invested after market peaks has been a better option.