U.S. stocks closed at fresh record highs on Friday on revived hopes for a U.S. - China trade deal despite mixed economic data.

The Dow hit 28,000 for the first time after posting a fourth straight week of gains, while the S&P500 index rallied for a sixth week, its longest winning streak since November 2017.

The Dow Jones Industrial Average DJIA, +1.33% rose 222.93 points, or 0.8%, to 28,004.89, while the S&P 500 index SPX, +1.59% gained 23.83 points, or 0.77%, to trade at 3,120.46. The Nasdaq Composite index COMP, +2.26% was up 61.81 points, or 0.73%, to 8,540.83.

Year-to-date the Dow is up 20.05%, the S&P 500 has gained 24.48% and the Nasdaq 28.72%

On Thursday, the Dow ended marginally lower, falling 1.63 points to 27,781.96, a day after eking out a record close. The S&P 500, meanwhile, tiptoed further into uncharted territory with a rise of 2.59 points, or 0.1%, to end at 3,096.63 — it’s 21st record close of 2019. The Nasdaq Composite edged 3.08 points lower, a decline of less than 0.1%, to finish at 8,479.02.

Read:‘Hindenburg Omen’ and ‘Ohama Titanic Syndrome’ form in a key stock-market index

What’s driving the market?

Equities markets have posted gains this week as investors remain hopeful that positive developments in U.S.-China trade relations will soon justify recent record highs for the major stock indexes.

“Investors continue to hang onto every word associated with the U.S.-China trade war,” said Russ Mould, investment director at AJ Bell. “White House economic adviser Larry Kudlow reportedly said that current negotiations between the two countries are ‘very constructive’, which was enough to drive stock markets up across the U.K., mainland Europe and most of Asia.”

Kudlow on Thursday said negotiators are getting close to an agreement, but that President Donald Trump wasn’t yet ready to sign off. Trump “likes what he sees, he’s not ready to make a commitment, he hasn’t signed off on a commitment for phase one, we have no agreement just yet for phase one,” he said at a Council on Foreign Relations event, according to The Wall Street Journal.

The first phase of an agreement that may have as many as three phases will be “relatively limited in scope,” with the major focus being on “current trade” and whether China is willing to commit to $40 billion to $50 billion of agriculture purchases, Commerce Secretary Wilbur Ross told Fox Business on Friday.

U.S. economic data also provided some evidence that consumers remain willing to spend, though at a slower pace than earlier this year. U.S. retail sales growth rebounded in October, rising 0.3% after a 0.3% decline in September, above the 0.2% growth expected by economists surveyed by MarketWatch. Excluding autos and gasoline sales, however, sales rose 0.1%, below the 0.4% consensus forecast.

But U.S. industrial output fell by the most in 17 months in October, down 0.8%, worse than the 0.5% decline expected by economists polled by MarketWatch. Industrial capacity in use slumped to 76.7 in October, the lowest level in slightly more than two years.

“Net net, monetary policy is in a good place but the road ahead for the economy looks rockier with the manufacturing recession deepening and consumers spending less this quarter than they did earlier in the year,” MUFG chief economist Chris Rupkey said. “The question is whether the economy is in a good place and whether stock market investors are blithely ignoring today’s real economic data news in favor of their hopes and dreams for a better tomorrow with a phase one U.S.-China trade deal in sight.”

Both the New York Federal Reserve and Atlanta Fed lowered their forecasts for U.S. fourth quarter GDP growth to 0.4% on Friday.

Which stocks are in focus?

Stocks that would benefit from a U.S. - China trade deal like Caterpillar CAT, +0.53% , Apple AAPL, +3.75% , and Boeing BA, +6.83% all rose.

Health care stocks rose XLV, +1.60% after Trump administration Friday released a far-reaching plan that would for the first time force hospitals and insurers to disclose their secret negotiated rates.

Shares of Applied Materials Inc. AMAT, +0.76% jumped after earnings beat Wall Street expectations even though the chip company late Thursday reported a fall in profit from a year ago. The chip makes outlook though also pointed to a recovery for the beaten-down semiconductor industry.

Chip maker Nvidia Corp. NVDA, +4.25% late Thursday forecast a return to revenue growth after four quarters of declines and beat estimates for its quarterly results but shares fell.

Shares of furniture maker RH RH, +0.96% were up more than 6% Friday after Warren Buffett’s Berkshire Hathaway Inc. BRK.B, +0.82% BRK.A, +0.43% revealed in a regulatory filing that it had bought 1.2 million shares of the company formerly known as Restoration Hardware.

Berkshire also revealed that it owned nearly 7.5 million shares of Occidental Petroleum Corp. OXY, -3.94% worth around $332 million as of the end of the third quarter. Berkshire in April committed $10 billion to help Occidental in its bid for Anadarko Petroleum Corp, giving the company an edge over Chevron Corp. CVX, +0.04% , which later bowed out of the fight for Anadarko.

Shares of J.C. Penney Co. Inc. rallied more than 7% after the department store retailer reported narrower-than-expected losses in the third quarter.

How are other markets trading?

The 10-year Treasury yield TMUBMUSD10Y, 0.657% rose 1.8 basis points to 1.833%, but down 9.7 basis points for the week, the largest such move in six weeks.

The price of a barrel West Texas Intermediate crude oil for December delivery US:CLZ19 rose 94 cents, or 1.7% to $57.71, though the commodity was still on track for weekly losses. The price of an ounce of gold for December delivery US:GCZ19 declined $4.90, or 0.3%, to $1468.50 as the safe haven lost appeal.

The value of the U.S. dollar edged 0.2% lower, according to the ICE U.S. Dollar index DXY, +0.23% .

In Europe, stocks were trading mixed, with the Stoxx Europe 600 SXXP, -0.09% up 0.4%