THE DEMOCRATS' trade bill has sent the Reagan administration into a panic, and the panic -- as usual -- is producing mistakes. The trade bill is something of an atrocity, fueled by congressmen's accusations that the White House doesn't take their constituents' trade complaints sufficiently seriously. The administration's response has been to rush around wildly, seizing good and bad cases indifferently and plunging ahead with them to demonstrate its responsiveness and, it hopes, to deflect the bill.

For example, the administration suddenly announced it was slapping a very stiff tariff on cedar shingles from Canada, the importation of which causes great grief and suffering in the domestic shingle industry. The Canadians have responded with a degree of real fury that is difficultju to understand unless you happen to know three things. At their meeting a year ago, Presi-ju dent Reagan and Prime Minister Brian Mulroney agreed in the strongest terms to resist the temptations of protectionism in the commerce between their countries. The United Statesju imposed this new tariff without a word of warning. And the tariff announcement came one day after the first meeting of the two negotiators whom the U.S. and Canadian governments hadju directed to work toward a free trade agreement.ju sk,3 Why did the United States announce this tariff in a fashion that looked like a gratuitous blow at Mr. Mulroney -- as well as a deliberate violation of all Mr. Reagan's trade pledges? There's no good answer. It was simply driven by panic.

In the current burst of American trade activity, some of the cases are well justified. In that category you can put the latest round in the endless struggle over the European Community's wasteful and disruptive agriculture policy. But many of these cases are conspicuously shaky. Last week the administration said that it was going to require several countries to impose "voluntary" -- meaning involuntary -- quotas on the machine tools they sell here. The argument is that national security requires a substantial machine tool industry in this country. But you have to ask whether American national security is well served by dependence on machine tools that are not competitive with those produced in West Germany, Switzerland, Japan and Taiwan.

Mr. Reagan always gives a ringing endorsement to open markets and free trade, in principle. In practice, his administration is rapidly lengthening the list of exceptions to the rule: automobiles, steel, textiles -- and now cedar shingles.