By Joe Wallace and David Benoit

U.S. stocks rose Friday, giving the S&P 500 its biggest weekly advance in three months as investors welcomed signs pointing to a decisive result in next month's presidential election.

The S&P 500 climbed 0.9%, ending its second straight week of gains. The broad benchmark was up about 3.8% this week, its best performance since early July.

The Nasdaq Composite rose 1.4%, and the Dow Jones Industrial Average climbed 162 points, or 0.6%. All three indexes closed Thursday at their highest levels since early September.

With just 25 days before the U.S. election, the race is dominating traders' attention.

For months, they have been wagering on extreme volatility around the election through the derivatives, stocks and currency markets, wary that the outcome could remain undecided for weeks. Some of the uncertainty surrounding the contest appeared to recede recently thanks to polls showing that former Vice President Joe Biden has scored a strong lead over President Trump.

"Polling has further consolidated around a Biden advantage in the presidential election...and options markets have significantly reduced the premium they assign to that date," JPMorgan Chase & Co. strategists wrote in a note to clients on Thursday.

Strategists say surveys and talks with investors have recently found a flip-flop on sentiment in the event of a Biden win: Investors previously said it would be bad for stocks, but they now are predicting it would boost markets.

A Democrat "Blue Wave" victory "has curiously flipped from consensus bear catalyst to bull catalyst," Bank of America wrote.

Investors have piled into individual stocks and sectors that would benefit from a Biden presidency. The price of the iShares Global Clean Energy ETF surged to the highest levels of the past five years this week as bullish options trading tied to the fund ramped up, too. Mr. Biden has proposed a $2 trillion plan to combat climate change.

Meanwhile, investors have cheered signs that Washington could reach a new round of stimulus. Few have expected a deal to be reached before the election, but Congressional leaders and White House officials are trying to bridge differences over a new batch of spending measures to help airlines, small businesses and households.

The White House is preparing a $1.8 trillion offer, its largest proposal in this round of talks, and White House adviser Larry Kudlow had said Friday on Fox Business that Mr. Trump had approved the plan. That provided a temporary boost to markets in the early afternoon.

"For the market to move higher, we need to see further stimulus in the U.S., to ensure that the recovery that is still ongoing can be at least smoothed over," said Brian O'Reilly, head of market strategy at Mediolanum International Funds.

The pandemic's impact on the economy will get fresh attention next week as the U.S. heads into earnings season. Analysts expect the S&P 500 to report a median 20% drop in earnings per share, according to FactSet.

But they have actually grown more optimistic in the past three months, increasing the median by 4.1%, according to FactSet's earnings analyst John Butters. That's the first time since 2018 analysts have grown more optimistic during a quarter.

Alexander Altmann, the head of Citigroup's equity trading strategy for the Americas, said those rising expectations are creating concerns of disappointment in the coming weeks. The targets seem to be saying many of the trends appearing in the pandemic are actually enduring shifts in consumer habits, which is likely only true for some.

"I wonder whether there's been a bit of a Y2K-effect where people rushed to set up home offices and get their gardening kits," Mr. Altmann said. "A lot of that is not repeatable business. That's where I think there's been a little bit of a risk."

Among individual moves, chip maker Xilinx had the biggest gain in the S&P 500, up 14%, after The Wall Street Journal reported it was in talks to be acquired by Advanced Micro Devices. The deal could be valued at more than $30 billion and mark the latest tie-up in the rapidly consolidating semiconductor industry. AMD fell 4.4%.

In bond markets, the yield on 10-year U.S. Treasury notes ticked up to 0.792%, from 0.764% Thursday. The WSJ Dollar Index, which tracks the U.S. currency against a basket of others, slipped 0.6%, putting it on course for a third consecutive day of declines.

Oil prices edged lower as traders tracked the progress of Hurricane Delta, which has brought offshore production in the Gulf of Mexico to a near standstill. U.S. crude futures dropped 1.7% to $40.50 a barrel and the energy sector was the worst performer in the S&P 500.

Gunjan Banerji and Jem Bartholomew contributed to this article.

Write to Joe Wallace at Joe.Wallace@wsj.com and David Benoit at david.benoit@wsj.com

(END) Dow Jones Newswires

10-09-20 1617ET