The swinging positions adopted by the US in international trade matters differ in accordance to the direction in which trade is happening.
On one hand, when the US claims for the supression of trade borders, taxes and dutie,s and for worldwide market openings, the US is thinking about exporting as cheap as possible. Like this, American goods are comercialized abroad at a low price and therefore, by the law of demand, high quantities of those goods will be demanded at that cheap price by foreign consumers. This is translated into economic growth for US companies that expand the size of their businesses abroad.
On the other hand, sometimes the US has been a clear supporter of protectionist economic measures. The main aim of promoting such measures is to protect national industries that are not very profitable and that cannot compete in the national markets against the cheap price of imports coming from foreign countrie. Those much cheaper imports are demanded by most consumers over national goods. To avoid bankruptcy in those uncompetitive sectors, duties and taxes are set to limit foreign trade inside its borders.