U.S. machine tool orders for July fell 19.7 percent from June as a result of seasonal factors, an industry association said yesterday, but the group expressed optimism that a 26.1 percent rise in exports heralds an improving trend.

Machine tools are a basic indicator of long-term economic strength, since lathes, grinding machines, drills and other metal working equipment are used to produce durable goods.

The National Machine Tool Builders Association said machine tool orders fell to $162.9 million from a revised $202.8 million in June, the association said. Last month the association reported the June total tool orders at $205.8 million.

Imports have been steadily eating away at U.S. market share since the mid 1970s and now comprise 50 percent of the market, the NMTBA says.

However, the total value of U.S. tool orders improved in May and June primarily because of automobile plants closings, the group reported. Production from these plants was transferred to outside suppliers who placed orders for tools, the association said.

The MTBA, however, is optimistic that tool orders will improve in upcoming months because of increasing U.S. exports. Between June and July, metal cutting tool exports rose 8.7 percent and metal forming tools rose 56.1 percent. For the year to date, exports of metal forming tools rose 127.9 percent.

"A drop in new orders at this time of year is characteristic of the machine tool industry; therefore, it's hard to interpret this month's data," said James Gray, president of the association, in a written statement.

"We're hopeful that in the fall the improving trends that emerge in late spring and early summer will continue.

"With a dollar at a much more realistic level than it's been in many years, American-made machines tools are becoming more competitive in the international market, a fact reflected in our improving export orders," Gray said. "Foreign tools are no longer the bargain they once were."

Eli Lustgarten, an analyst in New York for PaineWebber Inc., said he expects the industry outlook to brighten by the start of 1988, as industries that use machine tools begin to gain strength.

However, some analysts were less enthusiastic.

"Despite the fact that the dollar has declined by a substantial amount, it hasn't affected machine tools," said Christine Chien, New York analyst with Prudential-Bache Securities Inc.

Chien also said that voluntary agreements, with Japan and Taiwan have not yet affected the industry. Those agreement went into effect at the beginning of the year. Under the accords, those countries will restrict exports to the United States for five years.

"The basic thing is that the demand for the machines is slow. If your're not selling a lot to begin with," the voluntary agreements are "not much of a big deal," said David Sutliff, an analyst with Salomon Brothers Inc.

In its monthly statistical report, the tool industry trade association also reported that July orders were down 4.2 percent from total orders of $170.0 million in July of last year.

The association said metal-forming tool orders fell 30.9 percent last month to $60.7 million from a revised $87.8 million in June, and were up 47.3 percent from $41.2 million in July 1986.

Metal-cutting tool orders totaled $102.2 million in July, off 11.1 percent from a revised $115.0 million in June and 20.7 percent below the $128.8 million in new orders for July 1986.

The association said the backlog of orders in July was $1.06 billion, off 3.3 percent from the revised June backlog of $1.09 billion and 13.2 percent below the backlog in July of last year.

The association said that total shipments of machine tools declined 15.2 percent last month to $197.8 million from a revised $233.2 million in June and were up 4.1 percent from the $190.1 million in orders in July of last year.

Last month the association reported the June total shipments of machine tools at $233.5 million.