Investing when the market blows hot and cold