NEW YORK, SEPT. 9 -- The dollar edged higher against most major foreign currencies in moderate trading today, buoyed by a perception that key U.S. trade figures to be published Friday might not be as bad as previously expected.

Gold prices declined. Republic National Bank of New York quoted a bid for gold of $457.10 a troy ounce, down from Tuesday's late bid of $458.

Traders said many market participants who recently sold dollars bought them back to balance their currency positions in the expectation that Friday's report on the U.S. trade deficit for July could be more encouraging than earlier projections.

"It's kind of a manic-depressive market ... the focus on the trade number is almost obsessive," said James Vick, vice president and senior corporate trader at Manufacturers Hanover Trust Co. "There had been a lot of selling {of dollars} in anticipation of a bad number."

Investors are focusing on the trade figures because the U.S. trade deficit has been at the root of the dollar's weakness. The Commerce Department said the gap widened to an all-time high of $39.5 billion during the second quarter.

The trade figures spurred investors to sell dollars by raising concerns that the Reagan administration might allow the dollar to fall further in an attempt to cut the trade shortfall. When the dollar is down, imports are more expensive, but U.S. goods become cheaper overseas.

Projections for the July trade gap have ranged from $13 billion to $20 billion. The market consensus today appeared to be that the number will likely fall within the low part of the range, traders said.

In Tokyo, where the global trading day begins, the dollar traded at 141.45 Japanese yen, down from 141.70 yen late Tuesday. Later, in London trading, the dollar was quoted at 141.20 yen. In New York, the dollar was quoted at 141.80 yen, up slightly from 141.51 yen late Tuesday.

In London, the dollar rose against the British pound. It cost $1.6570 to buy one pound, compared with $1.6600 late Tuesday. By the end of New York trading, the pound stood at $1.6467, cheaper than the $1.6612 posted late Tuesday.

Gold was higher in Zurich and Switzerland, and lower in London.