Lost in the red ink of the American trade deficit with Japan and the bitter headlines about trade friction is an untold story of increasing cooperation and healthy economic interaction between Japan and the United States. To be sure, the darker side of the equation is real, and there are myriad problems to be addressed. But this should not obscure the fact that both sides are dealing with the difficulties with measurable, if less than total, success. There are distinct signs of hope and progress amid the doom and gloom.

The economies of the United States and Japan are closely intertwined. Japan is America's largest overseas trading partner, and for Japan, the United States is the most important trade relationship, the basis of Japan's postwar prosperity. At the present time, both countries are enjoying particularly good economic conditions: real growth with low inflation.

If the United States and Japan are engaged in a war over trade, as the doomsayers suggest, why are economic conditions relatively good, and why are we doing more business togther than ever before? It is because the trade statistics and the imbalance in favor of Japan are only part of the story.

There is a bright side to the trade picture with Japan, a side that has gained luster in recent months. Here are some of its elements:

*American investment in Japan is up almost 30 percent over 1984. Most of this is in the form of joint ventures with Japanese companies to produce goods for sale in Japan that are not counted in the raw trade statistics.

*Japan is now a major customer for securities in American corporations; this year over $2.5 billion has been raised on Japanese capital markets in the form of "Euroyen issues" -- yen-denominated securities -- at a savings of about a quarter of a point in interest over usual issues.

*Japanese investors will purchase about $60 billion in U.S. government securities this year, recycling the trade surplus and holding down U.S. interest rates.

*America enjoys a surplus with Japan in trade in services -- insurance, banking, etc. -- and this should increase with further liberalization.

*The availability of Japanese exports for sale in the United States has contributed to the relatively low rate of inflation in the United States, despite an economy that is expanding faster than at any time since 1951, and unemployment levels that have fallen to pre-recession levels.

*Most important, through the coordinated action of the Group of Five leading industrial nations, the value of the dollar has been reduced dramatically, helping U.S. exports and making imports more expensive.

Although the process is terribly slow and painful, the intensive campaign by the United States to improve access of U.S. exports to the Japanese market has achieved some success. Quotas and tariffs on a number of products have been reduced. In May 1984 Japan agreed to permit liberalization of its capital markets and to allow foreign banks to conduct trust activities. Negotiations are continuing in a wide variety of areas, such as semiconductors, leather, aluminum and tobacco. Japan has cooperated in implementing the Group of Five agreement, and as a result the yen has fallen to a five-year low against the dollar in a relatively short time.

What this suggests is that the United States should resist the siren song of protectionism and develop alternative and cooperative policies with Japan to reduce the trade deficit.

First, we should continue to press Japan to adopt a wide variety of market-opening measures, especially in areas where U.S. companies enjoy a comparative advantage. Next, we should implement macroeconomic solutions that rationalize trade and financial flows. In the area of fiscal policy, we should press Japan to adopt expansionist policies that stimulate domestic demand for goods and services.

We must also put our own house in order to control spending and our budgetary deficit. International monetary reform is also imperative for a long-term solution of the problem. The Group of Five agreement should be expanded and institutionalized to put the dollar, the yen and other currencies on a more stable footing.

We have already made a start on these issues, and we must stay the course. This will require great patience and political restraint. A quick fix in the form of protectionism would be a disaster, not only for Japan but for the economic and security interests of the United States.