Stocks rose for the first time in three days on Wednesday as traders hoped for some kind of deal to come from U.S.-China trade talks beginning on Thursday, even if it's a limited pact.

The Dow Jones Industrial Average gained 180 points, or 0.7%. The S&P 500 climbed 0.9% while the Nasdaq Composite advanced 1%. Stocks narrowed their gains heading into the close after Reuters reported China had lowered their expectations for these talks.

Apple shares contributed to the gains, rising 1.3% after an analyst at Canaccord Genuity hiked his price target on the iPhone maker to $260 per share from $240. Tech was the best-performing sector in the S&P 500, gaining more than 1%.

Earlier in the day, Bloomberg News reported China is prepared to accept a partial trade deal as long as no more tariffs are imposed by President Donald Trump. The report added that Beijing would offer non-core concessions like purchases of agricultural products in return, but not budge on major sticking points between the two nations.

Separately, the Financial Times reported that officials in China are offering to increase purchases of U.S. agricultural products, in order to reach a partial deal.

"It is harder to imagine an S&P 500 at similar/higher levels in October 2020 without a trade deal, better confidence over global economic growth, and improved corporate earnings," said Nicholas Colas, co-founder of DataTrek Research. "However, it is worth remembering that other markets do not agree with these bearish fears." He noted investment grade and high-yield corporate spreads remain "fairly tight."