Stocks touch record highs before giving up most of those gains into the close

Dow closes above 29K for first time following US-China trade deal signing
Dow closes above 29K for first time following US-China trade deal signing

Stocks rose on Wednesday, but gave up most of their gains heading into the close even after the U.S. and China signed a highly anticipated phase one trade agreement.

Most of the details were already known and investors anticipated some speed bumps on the way to phase two's signing.

The Nasdaq Composite closed just above the flatline at 9,258.70. The S&P 500 ended the day up 0.2% at 3,289.29 while the the Dow Jones Industrial Average gained 90.55 points, or 0.3% to close at 29,030.22. At its session high, the Dow was up 187.92 points, or 0.7% while the S&P 500 and Nasdaq gained as much as 0.5% each.

The U.S.-China trade agreement includes provisions to curb intellectual property theft along with forced technology transfers. It also increases Chinese purchases of U.S. products. Investors had been eagerly awaiting the signing of the so-called phase one trade agreement as the conflict between the world's largest economies has dragged on for nearly two years.

"The risk in the market is that the trade situation deteriorates, not that it stays the way it is," said Willie Delwiche, investment strategist at Baird. "If it's improving, then by definition it's not deteriorating and that's a good thing."

To be sure, the deal does not remove existing U.S. tariffs on Chinese imports and leaves questions as to how the terms of the agreement will be enforced. The deal is also seen as "fragile" by some analysts who believe additional levies could still be implemented.

U.S. President Donald Trump speaks during a signing ceremony for the U.S.-China "phase-one" trade agreement in Washington, D.C., U.S., on Wednesday, Jan. 15, 2020.
Zach Gibson | Getty Images

Sentiment was aided earlier amid comments from White House economic advisor Larry Kudlow, who said the Trump administration would unveil more tax cuts later this year.

Wall Street also kept an eye on Corporate America as the earnings season kicked into full gear. Bank of America reported quarterly results that beat analyst expectations as bond-trading revenue ripped higher.

Goldman Sachs posted a revenue for the quarter that surpassed estimates. BlackRock, UnitedHealth and PNC Financial also posted quarterly earnings that beat analyst expectations.

So far, about 30 S&P 500 companies have released their quarterly numbers. Of those companies, 82% have posted better-than-expected profits, according to FactSet data.

Expectations for corporate profits were downbeat heading into the reporting period. FactSet estimated S&P 500 earnings to have fallen 2% in the fourth quarter on a year-over-year basis.

But Mark Haefele, global chief investment officer at UBS GWM, has a more upbeat outlook on the earnings season.

"We see the upcoming reporting season marking a turning point after a period of weak profit growth for US companies, one that should push equities higher this year even though the potential for further multiple expansion is modest in our view," he said in a note. "So we have modestly increased our forecast for US EPS growth to 6% this year."

In other corporate news, Target shares dropped more than 6.5% after the retailer announced disappointing holiday same-store sales. Target said its same-store sales during the holidays rose just 1.4%, compared to growth of 5.7% from the prior year.

—CNBC's Silvia Amaro contributed to this report.

Correction: A previous version of this story misspelled Willie Delwiche's last name.