By James Ramage

The dollar shuffled between small losses and gains against the euro and other rivals on Tuesday as investors remained uncertain about the direction of the U.S. economy and the timing of an expected rise in borrowing costs.

The dollar traded flat versus the common currency, with one euro buying $1.0741, remaining between $1.05 and $1.10 as it has since February. The Wall Street Journal Dollar Index, which pits the greenback against a basket of 16 widely traded currencies, inched up 0.1% to 87.29 and is up 5% this year.

The dollar has struggled to gain traction against its rivals as softer-than-expected U.S. data over the past few weeks have sown doubts among investors that the economy is on strong enough footing for the Federal Reserve to raise interest rates anytime soon.

"There's still concern over whether the moderation we've seen in the U.S. economy will be more persistent than both we and the Fed expect," said Brian Daingerfield, currency strategist at RBS Securities. "Until we see more certainty in the trend of the U.S. economy, we'll see choppy trading in the dollar."

An absence of new economic numbers has complicated investors' outlook. That could change next week as investors look forward to measures of U.S. growth and manufacturing, as well as a meeting of the Fed's monetary policy committee.

Still, most investors are confident in the dollar's longer-term prospects as they believe the Fed remains on track to raise short-term interest rates for the first time since 2006 while other major central banks hold to loose monetary policy to boost growth and inflation. Elevated U.S. rates would mean higher returns on assets denominated in dollars, attracting investors to the U.S. currency.

The dollar gained 0.4% versus the yen, rising to Y119.68, as investors bet on further easing to the Bank of Japan's monetary policy after Japanese Prime Minister Shinzo Abe nominated Yukitoshi Funo, a senior adviser of Toyota Motor Corp., a beneficiary of the weaker currency, to join the central bank's policy board this summer. Mr. Funo would succeed Yoshihisa Morimoto, a board member who opposed future expansion of the central bank's massive asset-purchase program, when Mr. Morimoto's term expires June 30.

Write to James Ramage at james.ramage@wsj.com