The government's main gauge of future economic activity yesterday signaled a continued lackluster performance by the economy.

The Index of Leading Economic Indicators, designed to predict economic activity in the next six months, increased a slight 0.4 percent in July, and has risen only slightly in the last three months following a weak performance for most of the year.

The Commerce Department also reported that new orders for factory goods, which also foreshadow the pace of the economy, declined in July by the sharpest amount since September 1984. The report suggested that demand for goods is still slow and manufacturing production in the future will be sluggish.

Meanwhile, U.S. purchases of foreign goods exceeded exports by $10.3 billion last month, but economists said that the decline in the trade deficit, following three successive months of expansion, did not reflect an improvement in the ability of American businesses to sell overseas.

Rather, they said the smaller deficit was caused largely by a reduction in the value of oil imports because of lower petroleum prices, and weakness in the U.S. economy, which discouraged purchases of foreign goods.

Economists weighing the latest reports said they indicate the economy will pick up slightly, but substantially less than the 5 percent growth in output expected by the Reagan administration to keep unemployment from rising further and hold the federal budget deficit under control.

The administration took a more optimistic view, however. White House spokesman Larry Speakes called the July rise in the leading indicators a "solid advance."

"The leading index has shown solid growth over the last three months," Speakes said. "Several other statistics, notably employment, auto production and Thursday's announcement of a 1.4 percent rise in new-home sales all show an economy that continues to expand."

Actually, employment gains have been weak all year and the unemployment rate has remained stagnant for the past six months. Despite the increase in new-home sales, housing construction dropped dramatically last month and has been less than spectacular all year.

The reports on factory orders and the leading indicators are "a continuation of evidence that the second half is going to be better than the first half, but not great," said David Wyss, senior vice president of Data Resources Inc.

Wyss said that factory orders declined so much last month because they had been elevated in previous months by large defense orders.

On the leading indicators, Wyss said, "What's a little disturbing is that most of the increase was from the financial numbers" such as growth in the money supply and stock market prices, rather than in gauges of future factory production. "The real side is still showing no strength. It does cast doubt on whether production is going to come up as much as we had hoped. We'll probably have a few more quarters of muddling through."

"The meager rise of the leading indicators over the past two months and the July decline in orders for manufactured goods is further evidence that the economy continues in a holding pattern," said Jerry Jasinowski, chief economist for the National Association of Manufacturers. "Real economic growth is limping along in the 1 to 2 percent range with no clear sign of revival at this point."

Meanwhile, the Reagan administration yesterday revised downward its projection for the fiscal 1985 federal budget deficit to $211.3 billion from $213.3 billion. The administration also estimated the deficit for fiscal 1986 at $178 billion, basically unchanged from its earlier forecasts.

The administration estimates assume that no recession will occur, and they include technical re-estimates of the rate of spending on federal programs this year, the effect of recent legislation on the budget and administration policy changes since April. Two components of the leading indicators -- contracts and orders for plant and equipment, and new orders for consumer goods and materials -- are important gauges of future production and economic growth.

In July, orders for consumer goods increased while those for plant and equipment declined.

Six of the leading indicators contributed to the index increase. They were money supply, stock prices, average weekly initial claims for state unemployment insurance, net business formation, change in credit outstanding, and manufacturers' new orders for consumer goods.

Three of the indicators having a negative impact were changes in sensitive materials prices, building permits and the contracts and orders for plant and equipment.

Average workweek and vendor performance, which gauges the strength of business activity by measuring the speed at which companies receive deliveries, were unchanged.

Commerce said that new orders for factory goods in July dropped 1.3 percent, the sharpest drop since they fell 1.6 percent in September last year. The July decline followed a 1.7 percent increase in June and a 2.1 percent increase in May.

New orders for durable goods dropped 2.3 percent, largely because of a decline in automotive sales. Transportation equipment orders dropped 5.6 percent, Commerce said.

Orders for electrical and nonelectrical machinery dropped, offsetting most of the increases in June, Commerce said. Primary-metals orders also declined in June by 1.5 percent.

Nondurable-goods orders also declined 0.2 percent in July.