(Reuters) - Wall Street extended its rally into a fifth straight day on Thursday in a session of whipsaw trading as investors responded to mixed comments by Federal Reserve Chairman Jerome Powell, while a warning from Macy’s pummeled retail stocks.

Powell reiterated the views of other policymakers that the Fed would be patient about interest rate hikes. But major stock indexes temporarily moved into negative territory after Powell said the bank’s balance sheet would be “substantially smaller,” and after he raised concerns about the size of U.S. debt.

“That’s what spooked the market a little bit. It’s more of a commentary on the entire economy as a whole,” said Randy Frederick, vice president of trading and derivatives for Charles Schwab in Austin.

The S&P 500 .SPX is up over 10 percent from a 20-month low it touched around Christmas, lifted by hopes for a U.S.-Chinese trade deal, which eased some worries over the impact of the dispute on global growth. The benchmark index's five-day winning streak is its longest since September.

Trade-related optimism faded somewhat as China offered little in the way of details on key issues such as forced technology transfers, intellectual property rights, tariff barriers and cyber attacks.

In the United States, reports from Macy’s and American Airlines added to concerns that growth of corporate profits would slow.

Macy's Inc M.N stock plunged 17.69 percent and pulled down other retailers after the department store operator cut its same-store sales forecast for the full year because of weak demand during mid-December.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., January 10, 2019. REUTERS/Brendan McDermid

S&P 500 companies on average are seen posting 14.5 percent growth in earnings per share as they report December-quarter results over the next few weeks, according to IBES data from Refinitiv. However, expectations for growth in 2019 are at 6.4 percent, down from an expectation of 7.3 percent on Jan 1.

“It could be a good quarter, but maybe with more cautious outlooks until we get something that comes out of the trade negotiations,” said Kurt Brunner, a portfolio manager at Swarthmore Group in Philadelphia. “There is a lot of uncertainty there.”

The Dow Jones Industrial Average .DJI climbed 0.51 percent to end at 24,001.92 points, while the S&P 500 .SPX gained 0.45 percent to 2,596.63.

The Nasdaq Composite .IXIC added 0.42 percent to 6,986.07.

Trade-sensitive industrial stocks .SPLRCI rose 1.44 percent, lifted by Boeing Co BA.N, which gained 2.55 percent after the U.S. Air Force accepted its long-delayed KC-46 air tanker.

American Airlines Group Inc AAL.O fell 4.13 percent after the No. 1 U.S. carrier cut its fourth-quarter profit and unit revenue forecasts. That weighed on other airline shares as well.

Ten out of 11 S&P sector indexes rose, led by a 1.55 percent increase in real estate .SPLRCR, with consumer discretionary .SPLRCD ending down 0.23 percent.

Advancing issues outnumbered declining ones on the NYSE by a 1.61-to-1 ratio; on Nasdaq, a 1.19-to-1 ratio favored advancers.

The S&P 500 posted no new 52-week highs and 1 new low; the Nasdaq Composite recorded 18 new highs and 12 new lows.

Volume on U.S. exchanges was 7.3 billion shares, compared with the 8.9 billion-share average over the last 20 trading days.