The federal government has been closed for a record 28 days. About 800,000 federal workers are furloughed and not collecting paychecks. President Trump and House Speaker Nancy Pelosi are trading daily insults. The world’s largest democracy is at a standstill.

And stocks are having their best January in 30 years.

“The stock market is not interested in watching this reality show,” said Nancy Tengler of Tengler Wealth Management. “What it is interested in is that the world outside of D.C. is still growing. Employment is full and the Federal Reserve is tempering the rhetoric. And China just threw out an olive branch in the form of a six-year, $1 trillion buying spree of U.S. goods.”

The Dow Jones industrial average added to its January comeback with another strong day on Friday, sailing upward 336 points, or 1.4 percent, to close at 24,706. The Dow is up 5.9 percent to start 2019, and up 13 percent since its Dec. 24 low.

The S&P 500-stock index finished at 2,671 Friday, up 35 points, or 1.3 percent. The S&P is up 6.5 percent for 2019 and has risen more than 13.6 percent since Dec. 24. It is having its best January since 1989. All 11 sectors in the S&P are positive for the year, led by the financial stocks.

Both the S&P and the Dow have exited correction territory. A correction is a decline of 10 percent off a recent high.

The Nasdaq Composite is up 7.6 percent this year and surged 73 points on Friday to finish at 7,157, a jump of 1 percent.

“It is a very good month,” said Howard Silverblatt of S&P Dow Jones Indices.

Beyond the shutdown fiasco in Washington, economic news has been generally good. Gasoline prices average $2.24 per gallon, down 60 cents from six months ago and the lowest price since July of 2017, according to AAA. Wages are up. Inflation is down. Mortgage rates are at their lowest level in nine months. Unemployment remains at near-record lows.

J.P. Morgan Chase chief executive Jamie Dimon, who chairs the D.C.-based Business Roundtable, said in a call with reporters this week that the economy is good but that the shutdown could severely harm economic growth if it continues through the end of March.

“It’s more of a political issue than anything else,” Dimon said on the call, according to a CNBC report. “Consumers are in good shape, they’re spending money, they’re saving money, household formation is going up, wages are going up.”

The booming stock market is reacting to easing tensions in the trade war between the United States and China and to the Federal Reserve’s more moderate attitude toward rate increases.

“The government shutdown is a distant third in the list of things that have affected the short-term performance of the stock market,” said Washington investor Michael Farr. “First would be the Fed’s posture with regard to monetary policy. Second is the progress in trade negotiations with China.”

Gregory Davis, chief investment officer at the $4.9 trillion Vanguard Group, said the Fed’s signaling that it will be more patient in terms of raising interest rates “has decreased the likelihood that there is going to be a recession this year. The stock market views a patient Fed as a positive.”

Earnings season just finished its first week, and although there were signs of softening, most companies reported good results. Goldman Sachs’s stock had its best day in 10 years after smashing earnings expectations.

“Stock prices change in reaction to the expected level, growth, and discount rate applied to future profits extending many decades into the future,” said Chris Brightman, chief investment officer of Research Affiliates, an institutional investor with more than $200 billion under management. “A dip in this year’s profits is nearly irrelevant to stock prices if those profits are expected to fully recover in the following year or two.”

Not all the news has been good. The University of Michigan on Friday said its consumer sentiment index in January skidded to a reading of 90.7, the worst since October 2016. Economists had forecast a reading of 97.5.

Fitch Ratings earlier this month warned that an extended shutdown could endanger the country’s AAA credit if lawmakers are unable to pass a budget or manage the debt ceiling.

“The greatest threat to stocks would come from a downgrading of U.S. credit,” said Kristina Hooper, chief global market strategist at Invesco.

And eventually, the economic effects of the shutdown will begin to spread. Everything from drug approvals to airline travel to small-business formation could be imperiled if the Trump-Pelosi feud over funding for a wall on the southern border drags on.

Kevin Hassett, chairman of the White House Council of Economic Advisers, said the shutdown should temporarily reduce economic growth by 0.13 percentage points for every week that it lasts.

But he noted that most of the loss will be made up when the government reopens.

Farr said most investors think cooler heads will prevail before the shutdown inflicts lasting economic damage.

“The optimism surrounding the Fed and the China trade negotiations is more than enough to offset the risk of a prolonged government shutdown,” Farr said.