Stocks have rallied sharply for more than three months in anticipation of a rebound in the second half of the year .