The Trade Balance
Another component of the basic macroeconomic identity is the trade balance. Exports add to aggregate demand, and imports subtract from aggregate demand. The difference between the two, exports minus imports, is net exports, which we will call X. For the U.S. economy, X has been negative for many years, which means that we have been running a deficit in the balance of trade.
Including net exports in the basic macroeconomic identity, we have
 Y = C + I + G + X
How can we export more than we import? Our trade deficit is financed by what is called the capital account. Foreigner purchase American assets (stock and bonds), and we purchase foreign assets. In recent years, foreigners have purchases of our assets have exceeded our purchases of foreign assets. In effect, we have traded paper assets for real goods and services. Eventually, foreigners will be able to cash in their paper assets and receive American goods and services in return.
Another way to look at the basic national income accounting identity is in terms of sectoral saving. There are three sectors--the private sector, the government sector, and the foreign sector. Net private sector saving is S-I, which is private saving minus private investment. Government saving is T-G, which is taxes minus government spending. Our saving in the foreign sector is X. When we run a trade surplus (deficit), our foreign sector saving is positive (negative).
By definition, we have[1a] C + S + T = Y
We can combine [1a] and  to obtain
[1b] C + S + T = C + I + G + X
Subtracting C from both sides and re-arranging terms gives
[1c] (S - I) + (T - G) = X
This version of the basic accounting identity says that private saving plus government saving equals foreign sector saving. This identity always holds. It means that whenever our private saving is not sufficient to cover our government deficit, we are bound to run a trade deficit. In macroeconomics, we tend to view the trade deficit as resulting from an excess of domestic investment or domestic saving.
The Trade Balance and the Relative Price of Foreign Goods
Another aspect of the macroeconomic view of the trade balance is that "the capital account drives the trade account." That is, we believe that the relative demand for domestic and foreign assets is what determines the trade balance. The mechanism by which this occurs is the relative price of foreign goods.
For the United States, let e stand for the relative price of foreign goods in the United States. When e is high, foreign goods are expensive relative to our goods. This means that our exports are more competitive, so that we export more, while imports are less competitive, so that we import less. Thus, our trade balance, X, is positively related to the realtive price of foreign goods. A synonym for the relative price of foreign goods is the real exchange rate; hence, we call it e.
Suppose that you had two job offers, one in Detroit and one in Toronto. Which job should you take?
To answer this question, you would want to compare how well you could live in Detroit with how well you could live in Toronto. You would need to know the cost of housing, food, and so on in Toronto. Since prices would be quoted in Canadian dollars, you would want to convert back to American dollars. Then you could compare the cost of living in Detroit in American dollars. The ratio of the cost of living in Toronto to the cost of living in Detroit, measured in a common currency, is one measure of the real exchange rate. The more it costs to live in Toronto relative to Detroit, the higher the salary you would need in Toronto. As the relative cost of foreign goods rises, the cost of living in Toronto rises.
When foreigners are eager to buy American assets, they must acquire dollars to do so. By bidding up dollars in the foreign exchange market, they cause the relative cost of American goods to rise. From our perspective, this means that the relative cost of foreign goods falls. When the relative price of foreign goods falls, our exports are less competitive, and our net exports fall. Other things equal, this tends to exert a drag on our economy.
(The dirty little secret of international economics is that when the dollar becomes more valuable, we say that e falls. I try to stay away from this as much as possible, by focusing on the relative price of foreign goods. )