NEW YORK (Reuters) - Stocks on Wall Street logged modest gains on Tuesday as traders remained hopeful that the United States and China can work toward resolving their trade-related differences at the upcoming G20 Summit.

Oil prices remained weak, while the U.S. dollar, which has benefited from safe-haven flows this year amid increased uncertainty over global trade, rose against its peers.

White House economic adviser Larry Kudlow said on Tuesday that U.S. President Donald Trump will have a dinner meeting with Chinese President Xi Jinping at the upcoming G20 gathering in Argentina and held open the possibility that the two countries would reach a trade deal.

All three major U.S. indexes finished positive after spending much of the session in negative territory, as Kudlow said there is an opportunity to “turn the page” on a trade war with China.

His remarks followed Trump’s comments on Monday, when he said he expected to move ahead with raising tariffs on $200 billion in Chinese imports to 25 percent from the current 10 percent and repeated his threat to impose tariffs on all remaining imports from China.

“People want to believe that something good is going to come from the G20” meeting, said Robert Pavlik, chief investment strategist at SlateStone Wealth LLC in New York.

“(But) the longer it takes, the more concern the market feels that this is never going to happen, or it’s just more rhetoric and people start to lose faith.”

U.S. stock options traders are braced for a surge in volatility around the G20 summit.

The Dow Jones Industrial Average .DJI rose 108.49 points, or 0.44 percent, to end at 24,748.73, the S&P 500 .SPX gained 8.75 points, or 0.33 percent, to close at 2,682.2 and the Nasdaq Composite .IXIC added 0.85 points, or 0.01 percent, to finish at 7,082.70.

Traders work on the floor at the New York Stock Exchange (NYSE) in New York City, U.S., November 26, 2018. REUTERS/Brendan McDermid

European markets opened subdued, but dipped as trading progressed. The pan-European STOXX 600 index .STOXX lost 0.26 percent and MSCI's gauge of stocks across the globe .MIWD00000PUSgained 1.17 percent.

Trade-related worries lifted the greenback. The dollar index .DXY, which tracks the U.S. dollar versus the euro, yen, sterling and three other currencies, was up 0.3 percent at 97.369.

“Donald Trump’s renewed tariff threats against China have magnetized investors to the U.S. dollar,” Lukman Otunuga, a research analyst at broker FXTM, said in a note.

The Federal Reserve should be even more attentive to new economic data as its gradual interest-rate hikes edge it ever closer to a neutral stance, Federal Reserve Vice Chair Richard Clarida said on Tuesday.

Investors will now turn their attention to a speech on Wednesday by Fed Chairman Jerome Powell and minutes from the central bank’s Nov. 7-8 meeting, to be released on Thursday, for further clues of how many more times the Fed is likely to raise interest rates.

Sterling slumped against the dollar and the euro as doubts grew about whether British Prime Minister Theresa May can get a Brexit agreement through a divided Parliament.

Treasury yields fell on Tuesday afternoon after $40 billion of new five-year notes were sold to strong demand and on resurgent worries about U.S.-China trade tensions. The benchmark 10-year government note yield US10YT=RR was down 1.5 basis points from Monday's close, last at 3.06 percent.

In commodity markets, oil prices dipped, weighed down by uncertainty over the U.S.-China trade war and signs of increased global crude production. But losses were limited by expectations that crude exporters would agree to cut output at an upcoming OPEC meeting.

U.S. crude oil futures settled at $51.56 a barrel, down 7 cents or 0.14 percent, after slipping as low as $50.30 earlier in the session. Brent LCOc1 settled at $60.21, down 27 cents or 0.45 percent.

The stronger dollar weighed on gold, and spot gold XAU= slipped 0.62 percent to $1,214.66, a more than one-week low.