The dollar strengthened on foreign exchange markets yesterday but gave up some of its gains when the Federal Reserve failed to join six other central banks in intervening to support the U.S. currency.

Traders said central banks of Japan, Britain, Holland, West Germany, Switzerland and Italy stepped in to prop up the dollar, lifting it from its record lows of Monday and carrying stock prices higher.

But the dollar traded within narrow limits, and fell back when the Federal Reserve Bank of New York failed to join in, signaling to traders that Washington still is content to let the dollar drift.

On Wall Street, analysts credited the dollar's gains for a rebound in the stock market. The Dow Jones industrial average, which fell 76.93 points Monday, rallied at the opening and climbed 30 points before settling back to close up 8.79, at 1842.34. Analysts were not optimistic about the outlook for stock prices, however. {Story on F2}.

Another encouraging note for the dollar and stock markets came from the prospect of moves by West Germany to stimulate its economy.

After a strategy session among Finance Minister Gerhard Stoltenberg, Economics Minister Martin Bangemann and others, a senior government official said that a spending program adding about $13 billion to the German economy would be announced today after submission to the Cabinet.

The money would come through subsidized loans by the Kreditanstalt fur Wiederaufbrau, a government agency that finances new business ventures and extends credit to local communities.

U.S. officials and economists were cautious in appraising the program, uncertain how much of the funds would have been provided by private banks anyway. "I would call it a modest program, but welcome," said economist C. Fred Bergsten.

The West German government official, who spoke on the condition he not be identified, also hinted that the central bank would lower its discount rate from 3 percent tomorrow -- a step long urged by U.S. Treasury Secretary James A. Baker III.

"I would not be at all surprised" if the independent Bundesbank cuts the key rate when its governing council meets tomorrow, he said.

There were other reports that if the Bundesbank lowered the discount rate other European central banks would follow.

Lower interest rates in West Germany, England and elsewhere would have the same effect on the dollar as would a rise in U.S. rates: in either case the dollar would be strengthened because foreign investors would find it more attractive as the interest rate gap is narrowed between the United States and other nations.

A lower discount rate -- the interest charged on central bank loans to other banks -- also would help expand the West German domestic economy by making it cheaper for companies to borrow. U.S. officials are hoping for a reduction of at least half a percentage point, not a quarter point.

In foreign exchange trading yesterday, the dollar closed at 133.40 yen in New York, up from 132.23 on Monday, and at 1.6570 marks, up from 1.6380. The dollar also gained against the British pound, which was worth $1.8225 yesterday, compared with $1.8335 late Monday.

(The dollar continued to rise early this morning in Tokyo, trading at around 133.60 yen and 1.6589 West German marks.)

A West German official here said that the expansionary moves to be announced in Bonn today have been under discussion for at least two weeks. The decision to announce them now, rather than waiting for an expected meeting of the Group of Seven major industrial nations, is a way of demonstrating Germany's desire to meet its international responsibilities, the official said.

"The Americans aren't ready {with the budget reduction package}, but the world economy and the German economy require action," he said.

A meeting of the Group of Seven finance ministers and central bankers -- from the United States, West Germany, Japan, France, England, Italy and Canada -- is expected soon to review actions to strengthen international cooperation and to discuss ways of stabilizing the dollar.

Financial markets have anxiously been looking to such a G-7 meeting to restore a degree of confidence in the ability of major governments to deal with the basic questions of trade imbalances and volatility in exchange rates.

"The problem with the G-7 meeting is that people expect too much of it," said one European official.

Meanwhile, Prime Minister Margaret Thatcher said in the House of Commons that the British government would cut interest rates "when it is prudent to do so."

Basic bank lending rates have been cut in two half-point stages since the October stock market collapse, but the opposition Labor Party has been pressing Thatcher for more