As the U.S. dollar accelerates upwards, investors interested in profiting from the greenback's rise have several useful strategies they can employ. They can invest in U.S. companies that are major importers, foreign companies that are major exporters or a variety of funds that track the dollar.

Caution, however, should guide any investment. Currencies can fluctuate dramatically and can ruin the best laid plans of any company. Also, even if the dollar stays it course, currency valuations should make up only part of investment decisions.

Still, the upswing in the dollar can only be a good thing for major U.S. importers. It greatly enhances their ability to produce higher sales and profits and fatter margins.

The first beneficiaries that are likely to come to mind are retailers. They're heavy importers and the shares of many of the companies in the industry have moved up with the dollar lately, but some stand out more than others. One is appropriately named Dollar Tree  (DLTR) , while the other is TJX Cos.  (TJX) .

Dollar Tree is the seventh-largest importer. It shares have galloped ahead of the S&P 500 with the rise in the dollar, but more importantly, it has beaten the index over any time frame by a wide margin, yet has a multiple that is barely above it.

Like Dollar Tree, TJX, a holding in TheStreet's founder Jim Cramer's Action Alerts PLUS portfolio, has swamped the S&P year in, year out. Yet, it remains reasonably priced, exhibits healthy fundamentals and holds on to a strong buy rating from analysts surveyed by Zacks Investment Research.

Moreover, neither Dollar nor TJX lose in currency translation by being paid in foreign currencies from doing business abroad since nearly all their business is in the U.S.

That's different than for the biggest U.S. importer, Walmart Stores  (WMT) . The number one U.S. retailer receives a significant portion of its sales in foreign currencies earned from doing business internationally.

While, its stock has done well this year, it hasn't gained nearly as much as the other two over the past decade. Nor are its shares accelerating with the dollar as the other two have recently.

Foreign companies that are major exporters to the U.S. tell a story similar to Dollar and TJX only in reverse. The rising dollar gives them a boost by making them more competitive, then later they benefit from the currency translation.

One European exporter that stands out is Airbus  (AIR) . It's the largest foreign company in the U.S. aerospace industry. Its shares have shot up with the dollar and, after a weak year, is showing signs of returning to the form that swamped the S&P over the long run.

Investors can also invest in dollars directly, without having to get involved with risky currency trading or the shares of individual stocks. They can do this by buying a mutual fund or an exchange-traded fund that track the Dollar Index, which pits the dollar against a basket of currencies.

All three have beaten the S&P 500 handily as the dollar has gained strength in the past few months, but the Rydex Strengthening Dollar 2X Strategy  (RYSJX) is the leader so far. Another mutual fund, the ProFund Rising U.S. Dollar Fund  (RDPIX) and an exchange-traded fund, the Powershares DB US Dollar Index Bullish ETF  (UUP) , have also done well.

Whichever strategy investors choose, it may be the best opportunity to ride the dollar to capital gains to come along in a long while.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.

More from Investing

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

McDonald's Criticized for Not Doing More in Wake of Sexual Harassment Claims

McDonald's Criticized for Not Doing More in Wake of Sexual Harassment Claims

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Jim Cramer: The 10-Year Yield Could Go to 2.75%

Jim Cramer: The 10-Year Yield Could Go to 2.75%