The United States held its foreign trade deficit to $1.69 billion last month, confirming the recent gradual improvement in the nation's trade posture, the government reported yesterday.

There was a record volume of both exports and imports.

The statistics were made public unexpectedly a day ahead of schedule in an attempt to counter suspected leaks that officials said may have benefited some speculators in the international currency markets.

At the same time, there were reports that the Federal Reserve Board intervened aggressively in the currency markets to try to head off a second day's decline in the value of the dollar. The dollar recovered slightly in late trading.

Shortly after the trade figures were announced, Treasury Secretary W. Michael Blumenthal issued a statement saying they "reflect the continued improvement in our trade position," and would, if held firm, result in a $7 billion current account deficit.

Blumenthal's statement was obviously designed to help reverse the decline of the dollar. The secretary usually does not comment on the trade deficit. The current account measures trade and investment flows.

There was no immediate indication which, if any, speculators may have been obtaining early copies of the trade figures in previous months. Since markets react sharply to the statistics, traders can reap huge profits from leaks.

Although officials conceded they had no firm evidence of leaks so far, they said analysts had noticed some "unusual patterns" in foreign currency transactions just before publication of the figures in previous months.

Commerce Department security security officers said they are conducting an investigation to determine whether earlier figures had been given to speculators before the scheduled publication dates. Security measures were tightened last April.

The trade figures were released after the dollar plummeted earlier in the world's major currency markets, hitting new record lows for the second consecutive day before finally rising marginally when trading closed.

An earlier decline on Wednesday had been attributed to disappointment over President Carter's new anti-inflation program. However, it was clear late yesterday that the decline had snowballed. Some traders said it would be hard to halt.

Closing figures had the dollar at record lows in Frankfurt, Tokyo, Brussels and Amsterdam before release of the trade figures sent it rising briefly in New York. At the same time, gold prices soared worldwide.

The $1.69 billion trade deficit for September was essentially unchanged from the previous month's red-ink figure of the $1.62 billion. The August total had marked a decline from a $2.99 billion deficit in July.

The trade deficit has been declining steadily, albeit erratically, from a high of $4.52 billion in February. The deficit, which represents the excess of U.S. imports over exports, has continued for 28 months.

The September figure came in the face of a record performance on both the import and export side of the ledger - and despite an increase in U.S. oil imports, which rose a sharp 8 percent.

Overall, imports climbed $1.03 billion, or 7.3 percent, to a new total of $15.12 billion, while exports jumped $960 million, or 7.7 percent, to $13.43 billion. In August, imports fell 4.7 percent and exports rose 5.7 percent.

Imports increased in six of 10 major categories of commodities - mineral fuels, machinery and transport equipment, food and live animals, manufactured materials and chemicals.

There were sharp increases in U.S. purchase of foreign-made cars, sugar and coffee.

At the same time, the United States exported more machinery and transportation equipment, manufactured materials and chemicals than it did the previous month. However, American agricultural exports fell off.

The September figures brought the cumulative trade deficit for the first nine months of 1978 to $22.67 billion, up from $17.93 billion for the comparable period last year.