In a confused and hectic day on the world's gold and foreign exchange markets, the dollar continued to post gains in Europe, while gold -- which had plunged on Monday -- bounced back by $17 an ounce in Zurich and London, once again within hailing distance of the $400-an-ounce mark.

The dollar continued to respond to the new confidence inspired by the Federal Reserve Board's weekend moves to dampen the expansion of bank credit, and to let interest rates here soar. a move to a record 14 1/2 percent bank prime lending rate underscored the new high-interest trend in the United States.

In London, gold closed at $391.50 an ounce, and in Zurich, it wound up at $389.50, both $17 an ounce higher than Monday. at the peak last week, gold had skyrocketed to $444 an ounce.

Gold futures on the commodities exchanges were up by the allowable trading limits. Although there was little hard news to explain the new rise in gold, Treasury officials believe that buying probably was stimulated by 10 percent increases in the price of oil announced by Kuwait and Mexico.

This may foreshadow an OPEC-wide price increase later in the year -- a prospect which many oil market observers had anticipated earlier. OPEC is the Organization of Petroleum Exporting Countries. Lately oil and gold prices have tended to move together because it is assumed that Middle East money surpluses, swollen by the price increase, are moving heavily into the gold markets.

The dollar was so strong that it was reported that the West German central bank actually had sold dollars to temper the rise, the reverse of last week's activity when it was buying dollars to shore up the price.

West German Finance Minister Hans Matthoefer said in a formal statement in Bonn that the Fed's new measures "firmly aim at the inner causes of the dollar problem," and he revealed that the plan had been discussed in Hamburg on Sept. 29, when Fed Chairman Paul Volcker, and Treasury Secretary G. William Miller met with him and Bundesbank President Otmar Emminger.

American officials said that the general approach of a stronger monetary policy had been discussed at the Hamburg meeting, but not the specifics of the plans unveiled by the Fed last Saturday night.

In any event, German officials are known to be delighted that the dollar is turning stronger without the need. for German central bank intervention, which tends to inflate the German money supply and thus worsens the German inflation rate. In an interview in Belgrade last week, Matthoefer expressed the hope that the dollar-mark ratio eventually would return to 2 to 1.

It was far from that yesterday, to be sure, but the dollar rose to 1.8160 marks at one point before edging down to 1.7985, still higher than Monday's close of 1.7950 and well over the 1.72 low during the frantic trading of last week.

The dollar rose to 1.62605 Swiss francs from 1.6170 in Zurich and to 226.40 yen in Tokyo, the highest level in about 18 months, from 225.20 the day before.

In New York, all prices later edged down a bit on profit taking -- to 1.7867 marks, 1.6170 Swiss francs and to 225.85 yen. But one dealer predicted that the dollar would be more stable from now on, in part because higher interest rates make it more costly to sell "short" against the dollar.