Stocks posted solid weekly gains, but an ongoing U.S. government shutdown and worries about an economic slowdown in China pushed shares marginally lower on Friday.

The Dow Jones Industrial Average and both rose more than 2 percent this week while the Nasdaq Composite jumped 3.45 percent. Amazon and Facebook both rose more than 4 percent this week, while Netflix surged 13.45 percent as investors put money into the beaten-down names from December. The Dow and S&P 500 also posted their first three-week winning streak since August.

This week was also the calmest on Wall Street in a while. It was the fifth day without an S&P 500 move greater than 1 percent in either direction, the longest quiet streak since early October for the benchmark.

But Nancy Davis, CIO of Quadratic Capital, thinks volatility will remain high in the foreseeable future. "We've seen the rise in volatility coming back into the markets," said Davis. "This is just the beginning of what we should expect to see. These big ups and downs are going to become more common."

On Friday, the Dow slipped 5.97 points to 23,995.95 while the S&P 500 closed just below breakeven at 2,596.26. The Nasdaq Composite dipped 0.2 percent to 6,971.48. This was the first decline for the major indexes in six sessions.

The federal government remained partially closed on Friday for a 21st straight day, stoking fears the shutdown could drag on for a long time. On Thursday, President Donald Trump tweeted he would skip the annual World Economic Forum at Davos later this month due to the shutdown.

Tweet

Trump also said he will "probably" declare a national emergency if the White House and Congress cannot reach a deal to end the shutdown.

"We think a deal will be reached to reopen the government, but only after economic, financial and/or political pain is felt," Joseph Song, an economist at Bank of America Merrill Lynch, said in a note to clients. "Every two weeks of a shutdown trims 0.1 [percentage points] from growth; additional drag is likely due to delays in spending and investment."

Concerns over a possible slowdown in China weighed on equities Friday.

Goldman Sachs analyst Karen Holthouse said Starbucks would be the next company to warn of a slowdown in China following Apple's recent revenue guidance cut. "The recent AAPL [Apple] announcement (while potentially also product-driven) cited trade concerns/macro, and MCD [McDonald's] acknowledged softer trends in the region at a late November event," said Holthouse, who downgraded the coffee maker to neutral from buy.

Starbucks shares fell 0.7 percent.

Apple slashed its revenue guidance for fiscal first quarter last week, citing an unexpected slowdown in China. On Thursday, Federal Reserve Chairman Jerome Powell said that warnings shows the Chinese economy is slowing. "It's showing up a lot in consumer spending," Powell said. "Weak retail spending; everyone has seen the Apple news."

Concerns around Chinese economic growth come as China tries to strike a permanent deal with the U.S. to settle a punitive trade war. The world's largest economies have slapped tariffs on billions of dollars worth of goods since last year.