The United States and Canada agreed today that their top foreign affairs officials would hold four meetings yearly in an effort to overcome severe strains that have developed, primarily over issues affecting the two nations' troubled economies.

The agreement announced today by Secretary of State George P. Shultz and Canada's minister of state for external affairs, Allan MacEachen, appeared to signal a move from the confrontational atmosphere that has marked recent relations between the two countries.

In a press conference this afternoon, MacEachen and Shultz criticized protectionist sentiment that has been gaining ground in both countries and has been spilling over to affect the extensive economic ties. The two countries are each other's biggest trading partners, with total trade approaching $100 billion yearly.

The two officials, friends from student days at MIT, also said they had agreed to speed up efforts to find a solution to the problem of acid raid. Canada has complained that airborne pollutants from U.S. industrial production are carried into Canada and are badly damaging lakes, woodlands and wildlife. Shultz said in-depth studies into the issue by both sides are to be completed by the end of the year.

Shultz's 24-hour trip to the Canadian capital followed several steps by the government of Prime Minister Pierre Elliott Trudeau to reverse the economic nationalist image that has strained ties with American congressmen and investors.

A recent Cabinet change shifted several ministers identified with nationalist policies; Canadian diplomats in Washington have opened a campaign to paint a rosier picture of Canada's investment climate and leading American businessmen have been treated to top-level sessions with Trudeau and his Cabinet.

U.S. diplomats in Ottawa say they find the general atmosphere improved, but they stress that it is going to take time to see if that climate continues when the specifics of the complex economic measures that have so irritated relations will be discussed.

Canada's new industry minister, Ed Lumley, also took a wait-and-see attitude. In a telephone interview today, he said that the midterm elections next week and the formation of a new Congress will help determine relations between the two countries.

Many decisions in Washington are "strongly politically motivated," Lumley said. "They live in a political environment, too, just the same as we do . . . ."

Lumley noted, however, that despite contentious talk, only one piece of retaliatory legislation, a trucking measure, has been passed by Congress so far.

"What a lot of people here don't realize is that the Reagan administration to date has been on our side," he said.

Shultz underscored that point today by saying the administration opposes legislation limiting imports of uranium and the so-called Domestic Content Bill, which would require that substantial parts of cars sold in the United States be made with American-made parts and American labor.

Canada is a major producer of uranium and also is home for large numbers of plants producing cars and parts for the U.S. auto industry.

Lumley said he hoped to ease concern among American investors by speeding up and simplifying procedures of Canada's Foreign Investment Review Agency, which has been a major irritant. The agency must approve all new investment in Canada, although it does not affect expansion of existing plants.

Shultz said he urged the changes in the agency in the talks.

The officials also discussed a provision in Canada's national energy policy that allows the government-run oil company to buy into new fields that are developed by other companies. The provision has been a major issue, but it did not appear to have been resolved today.

U.S. energy companies complain that the law discriminates against them by giving exploration incentives to Canadian-owned companies.

While much of the focus in the talks between Shultz, MacEachen and their aides was on economic issues between the two countries, there also were lengthy sessions on international topics, including the Middle East and East-West trade relations.

Just before his departure for Washington, Shultz inspected the first of 137 special F18 combat aircraft to be delivered to the Canadian Air Force in a multibillion dollar deal.