Stocks have risen sharply for three days in a row, raising hopes that markets have hit bottom.