The S&P 500 Friday flirted with record levels on optimism over third-quarter results and prospects for a trade deal with China and Federal Reserve interest rate cut next week.

The Dow Jones Industrial Average jumped 152 points to 26,958, up more than 100 points for the week, while the Nasdaq Composite added 57 points to 8,243. The S&P 500 closed just 3 points below its record, adding 12 points to finish the week at 3,022.

Volume on the New York Stock Exchange totaled 3.3 billion shares with 1,645 issues advancing and 130 setting new highs, while 1,271 issues declined, 27 hitting new lows.

Nokia Corp. (NOK), PG&E Corp. (PCG) and Xunlei Ltd ADR (XNET) led the most actives.

The Treasury Department reported the fiscal 2019 deficit hit $984 billion, largely the result of the $1.5 trillion tax cut enacted at the end of 2017 and two congressional spending bills. The deficit is nearly twice what it was when President Trump entered the White House.

Investors were optimistic about prospects for a federal funds rate cut when the Federal Open Markets Committee meets next Tuesday and Wednesday. The market is looking for a 25-basis point cut in the current 1.75% to 2% target range.

Treasury Secretary Steven Mnuchin and U.S. Trade Representative Robert Lighthizer met by phone Friday with Chinese negotiators, trying to iron out details of a phase 1 trade agreement with Beijing.

The talks were described as "making headway" and were to continue at the deputy level, an administration statement said.

“The news about the trade war has continued to improve,” Michael Antonelli, managing director and market strategist at Robert W. Baird & Co., told Bloomberg. “It’s not solved, but news has been getting better. Earnings have been not as bad as people think. If this pace continues, it’s very possible earnings end up on the plus side of growth.”

“The market, I think, is desperately hoping for something good to happen,” Mark Stoeckle, chief executive officer at Adams Funds, told the Wall Street Journal. “People would like to have it [the trade war] behind us.”

Brexit’s fate again was in question as the Labour party pushed back on Prime Minister Boris Johnson’s effort to call an election for Dec. 12. The European Union is debating how long an extension to grant the United Kingdom now that it’s clear it won’t meet the Oct. 31 deadline for divorcing from the economic alliance.

Parliament earlier this week voted to approve the agreement Johnson worked out with the EU but then balked at the expedited timetable Johnson sought for final approval.

France is pushing for a short extension while other EU members were leaning toward three months, which would push the deadline to Jan. 31. Members met in Brussels Friday but decided to push a final decision into next week after the British Parliament votes on a general election.

Global markets were mixed. In Asia, Hong Kong’s Hang Seng closed 0.49% lower while Japan’s Nikkei 225 was up 0.22% and China’s Shanghai Composite rose 0.48%. Australia’s S&P/ASX was up 0.68%.

In Europe, London’s FTSE 100 closed off 0.05% while the German DAX gained 0.17% the French CAC was up 0.67%. The Stoxx Europe 600 added 0.36%.

The British pound was off 0.21% to $1.2824 while the euro slipped 0.21% to $1.108 and the U.S. dollar index gained 0.22%.

Oil futures were mixed. Crude oil gained 0.66% to $56.60 a barrel while Brent crude slipped 0.11% to $61.95. Gold and silver futures were higher. Gold added 0.18% to $1,507 per ounce while silver gained 1.38% to $18.05 an ounce.

Yield on the 10-year U.S. Treasury, which lost 3/32, rose to 1.8%. Yield on the 30-year note, which gave up 6/32, rose to 2.29%.