The Japanese yen weakened on Tuesday before the Bank of Japan’s decision on whether to hike rates while the dollar gained before the Federal Reserve’s meeting, where any new clues of a September rate cut will be in focus.

The BOJ will announce its rate decision at the conclusion of its two-day meeting on Wednesday. Markets are currently pricing in a 55% chance of a 10 bps hike.

The yen weakened ahead of the decision as investors closed positions following a significant rally this month that has seen the greenback lose around 4% against the Japanese currency.

“We've obviously had a very big move in the month of July,” said Brad Bechtel, global head of FX at Jefferies in New York. Traders "are probably cleaning up ahead of the events, and month-end flows are dominating today.”

Some economists are also not convinced that the BOJ is ready to hike rates.

"The market certainly has been quite excited about a rate hike, but economists and Bank of Japan watchers are far less certain," said Jane Foley, head of FX strategy at Rabobank.

The Japanese central bank will detail plans to taper its huge bond buying as it steadily unwinds a decade of massive monetary stimulus.

If the BOJ cuts its bond purchases and doesn’t hike rates that may be dovish or neutral, depending on the size of the taper, while a larger cut in bond purchases with a rate hike would be hawkish, said Bechtel.

But “either way… the yen is going to ultimately resolve weaker over time. It's just a question of how long that time period is,” Bechtel said. “There's no point in being long the yen because nobody wants to pay carry when they can earn carry in a myriad of other ways in the FX market.”

The dollar was last up 0.33% on the day at 154.52 yen . It hit a 38-year high of 161.96 on July 3, as the Japanese currency was hurt by the wide interest rate differential between the U.S. and Japan. The yen has since rallied with the help of several interventions by Japanese authorities.

The 200-day moving average at around 151.6 yen is likely to provide some support to the dollar.

The dollar gained 0.17% to 104.76 against a basket of currencies, the highest since July 11, before the Fed on Wednesday is expected to hold rates steady, but possibly give stronger clues that it is closer to rate reductions.

Traders see a rate cut in September as certain and are also pricing in a second and possibly third cut by year-end. The Fed is wary of hinting at cuts too soon in case inflation rebounds, which may make a signal more likely at the U.S. central bank’s economic symposium in Jackson Hole, Wyoming next month more likely.

The euro was down 0.2% at $1.0797 as investors digested data showing the euro zone's economy grew slightly more than expected in the three months to June, though a mixed underlying picture and a string of pessimistic surveys cloud the outlook for the rest of the year.

The German economy unexpectedly contracted in the second quarter after skirting a recession at the beginning of the year and July's inflation rose.

Sterling weakened 0.29% to $1.2822 before the Bank of England's Thursday meeting. Market pricing sees it as roughly a coin toss whether the BoE cuts rates.

In cryptocurrencies, bitcoin fell 1.60% to $66,289.

(Reporting By Karen Brettell; Additional reporting by Sruthi Shankar and Alun John; Editing by Sharon Singleton)