Fourth of July fireworks went off early on Wall Street as signs of a slowing economy gave traders reason to hope for more handouts from the Federal Reserve.

All three of the US stock indices hit record highs in Wednesday’s shortened trading session with the Dow Jones industrial average posting its first record close of the year after gaining 179.32 points — or 0.7% — to close at 26,966.00.

The S&P 500 and Nasdaq both jumped 0.8% with the S&P closing at 2,995.8 and the Nasdaq ending the day at 8,170.

“It’s early stock fireworks,” remarked Peter Cardillo, chief market economist at Spartan Capital Securities.

Wall Street popped stocks on growing expectations that the Fed will cut interest rates by the end of the month, which would lower the cost of borrowing and boost economy activity.

Driving those expectations are a combination of weakening economic data; President Trump’s new picks for the Fed, and a fresh face at the head of the European Central Bank that has the eurozone bracing for a new round of monetary easing.

While the US economy remains strong, there are signs that growth has tapered, including private payrolls rising less than expected in June.

That, plus growing trade deficit data, is raising hopes that the Fed could lower rates at an upcoming July 30 to 31 meeting in order to maintain the 10-year economic expansion. Nearly three quarters of analysts surveyed by Bloomberg anticipate a quarter point rate cut at the Fed’s meeting July meeting with 25.5% of Fed-watchers anticipating a half point cut.

Adding to hopes of lower rates are Trump’s newest Fed nominees, who are believed to support cutting borrowing costs.

The president, who has been very vocal about his desire for interest rates to move lower, tweeted late Tuesday that he intends to nominate Christopher Waller and Judy Shelton to the Fed’s board.

Waller is currently director of research for St. Louis Federal Reserve Bank President James Bullard while Shelton is US executive director at the European Bank for Reconstruction and Development — and both are expected to be dovish on rates, sources said.

The recent nomination of Christine Lagarde to the European Central Bank doesn’t hurt matters because Lagarde, currently head of the International Monetary Fund, is widely expected to seek to respond to falling inflation across Europe by making the cost of borrowing cheaper.

A survey of private sector employment released Wednesday by ADP and Moody’s Analytics showed 102,000 jobs added to the economy in June — down from the 135,000 expected. It also emerged Wednesday that the US trade deficit jumped to a five-month high in May, according to the Commerce Department.

The widening gap — which chips away at value of goods and services produced — comes even as the US slapped a new round of tariffs on goods coming from China earlier that month.

All of this will put a greater emphasis on Labor Department’s jobs report Friday, which will tell if last month’s dismal figure of 75,000 new jobs — down from 175,000 expected — was a fluke.

Either way, analysts say Friday’s report will be a “win-win” for the stock market with a strong number showing a robust economy while a weak number will force the Fed’s hand.

“Even better is if it is a weak jobs report, then stock investors can look forward to a lot of interest rate cuts from the Federal Reserve to stimulate more economic growth,” said Chris Rupkey, chief financial economist at Mitsubishi UFJ Financial Group.

“A good number or a bad jobs number, you can flip a coin, and it doesn’t matter, stocks are still going up and up and up,” Rupkey said.