U.S. stocks ticked somewhat higher Friday as the market headed for its best month in four years, enough to erase its losses from August and September.

OCTOBER SURPRISE: After a steep drop in late August and a rocky September, stocks came back in a big way in October and recovered those losses. The S&P 500 has risen for five consecutive weeks and is up 8.9 percent this month. That's good for the index's strongest month since October 2011.

GETTING STARTED: The Dow Jones industrial average added 39 points, or 0.2 percent, to 17,794 as of 1:50 p.m. Friday on Wall Street. The Standard & Poor's 500 index rose four points, or 0.2 percent, to 2,093. The Nasdaq composite index gained eight points, or 0.2 percent, to 5,082.

,b>CHINA FEARS WANE: The markets tumbled as investors worried that the slowing Chinese economy would prevent the U.S. economy from pulling out of a pattern of gradual but uneven growth it has followed since the Great Recession. Paul Christopher, global market strategist for Wells Fargo, said investors are now gaining confidence in the U.S. economy and that China won't suffer an abrupt downturn.

"We could see investors finally put that correction in August and those fears permanently behind them," he said.

Christopher said the November and December U.S. unemployment reports will help set the course of the markets for the rest of this year, along with the Federal Reserve's interest rate policies. He said the S&P 500 could set records in 2016, going as high as 2,200, but said next year might be uneven.

TIGHT PURSE STRINGS: Still, U.S. economic data still suggest feeble growth. The Commerce Department said Friday that consumer spending inched up just 0.1 percent in September, partly because consumers were spending less on gas as energy prices fell.

advertisement | advertise on newsday

The gain was the smallest in eight months. However consumers did spend more on services and on large manufactured goods like cars. Consumer spending is closely watched because it accounts for 70 percent of economic activity.

Incomes also grew 0.1 percent, and wages and salaries were flat.

ADDING TO THEIR NETWORK: The professional networking service LinkedIn delivered a strong third quarter. LinkedIn's profit surpassed analyst estimates and revenue was higher than expected. The stock gained $26.79, or 12.3 percent, to $243.79.

TAKING OFF: Online travel company Expedia rose $11.39, or 9 percent, to $138.45 after it said savings from its acquisition of Orbitz could be greater than it initially expected. Expedia bought Orbitz in September for $1.3 billion.

PARTLY CLOUDY: First Solar, the biggest U.S. solar company, advanced $5.66, or 11.1 percent, to $56.65 on a bigger-than-expected profit and more revenue. SolarCity, which installs solar panels in homes and businesses, fell after the company posted a bigger-than-expected loss and offered a fourth-quarter outlook that fell short of analyst forecasts. It plunged $9.37, or 24.6 percent, to $28.70.

GENWORTH SKIDS: Insurer Genworth Financial tumbled 43 cents, or 8.2 percent, to $4.79. The company has been selling some assets to improve its performance, but said that for now, its ability to take bigger steps in that direction is "limited." Genworth also reported a smaller-than-expected quarterly profit.

OIL SLICK: Chevron says it will eliminate around 10 percent of its jobs, or up to 7,000 positions, and will also slash capital and exploratory spending as it deals with lower oil prices that are cutting deeply into profit. The second-largest oil company said Friday that its profit fell 64 percent in the third quarter.

ABBVIE GRABS GAINS: Drugmaker AbbVie surged $5.90, or 10.9 percent, to $60 as sales of its blockbuster anti-inflammatory Humira continued to rise. Humira is the biggest-selling drug in the world and it's used to treat more than a dozen ailments included rheumatoid arthritis and psoriasis. Revenue for the drug totaled $3.65 billion in the third quarter, accounting for most of AbbVie's revenue.

UNDER THE WEATHER: CVS Health retreated $5.01, or 4.8 percent, to $98.79 after the drugstore chain and pharmacy benefits manager disclosed a disappointing third-quarter profit and its outlook for 2016 came up short of expectations.

GOING TO THE ATM: Commercial bank KeyCorp said it will buy First Niagara Financial Group for $4.1 billion, and its shares sank 84 cents, or 6.3 percent, to $12.54.

advertisement | advertise on newsday

VALEANT KEEPS SLIPPING: Shares of Valeant Pharmaceuticals, which skidded late Thursday, suffered more losses Friday as controversy around its drug prices and sales practices climbed. The stock sank $12.13, or 10.9 percent, to $99.37.

Late Thursday CVS said it was cutting ties with a specialty pharmacy called Philidor, which is linked to Valeant and has been criticized as a "phantom pharmacy" used to artificially boost Valeant's sales. The prospect of lost sales to CVS and Express Scripts, which also removed Philidor from its network after the market closed, hit Valeant's shares. Valeant says Philidor has informed it that it will shut down as soon as possible.

BONDS: Bond prices rose. The yield on the 10-year Treasury note fell to 2.15 percent.

ENERGY: Benchmark U.S. crude rose 36 cents, or 0.8 percent, to $46.45 a barrel on the New York Mercantile Exchange. Brent crude, which is used to price international oils, rose 65 cents, or 1.3 percent, to $49.45 a barrel in London.

CURRENCIES: The dollar lost value against the yen, falling to 120.68 yen from 121.11 on Thursday. The euro rose compared to the dollar, reaching $1.1022 from $1.0974.