One of the themes for 2017 has been a weak U.S. dollar. After a post-election rally, the greenback reached multiyear highs, finally peaking in January. Since then, the buck has been on a mostly downward trajectory.

However, the dollar's fortunes may be about to change. The U.S. Dollar Index finally showed some strength in September after a series of consecutive losing months. Could it be the start of a trend?

If the dollar does continue to strengthen, which companies stand to benefit?

Here's a rule of thumb: When the dollar is weak, look outward and invest in companies that do a significant amount of business outside the U.S. Think of some of this year's big winners, like Alphabet (GOOGL) , 3M (MMM) and McDonald's (MCD) . Those companies have significant overseas operations.

However, when the dollar is strong, look inward and buy companies that do the lion's share of their business within the U.S.

A good example would be regional banks. Unlike their multinational counterparts, regional banks have little to no international exposure, and therefore are insulated from the negative effects of a strong dollar. Names like SunTrust Banks (STI) , BB&T (BBT) and Capital One (COF) fall into this category.

What about restaurants? You can find a McDonald's almost anywhere in the world, and that makes it a great stock to own when the dollar is weak. When the dollar is strong, look for chains that have little to no overseas exposure, like Texas Roadhouse (TXRH) , Red Robin Gourmet Burgers  (RRGB) and Sonic (SONC) .

Who else benefits from a strong dollar? We can invest in foreign-based companies that do a significant amount of business inside the U.S. Some companies that fit this description include consumer-products giants Unilever (UL) and Nestle (NSRGF) and commercial airline manufacturer Airbus (EADSY) .

In Washington, proposed changes to corporate tax laws could have a side effect of making the dollar even stronger. White House economic advisor Gary Cohn is floating a proposed 10% tax on funds held overseas by U.S. companies.

Companies like Apple (AAPL) , Alphabet, Cisco Systems (CSCO) and others hold an estimated $2.6 trillion overseas. If the tax rate on funds repatriated to the U.S. is temporarily cut to 10%, it could unleash a significant flow of capital, which in turn would cause an upward surge in the dollar.

The bottom line: 2017 will likely be remembered as the year of the weak dollar, but 2018 could be an entirely different story. Now might be a good time to formulate your game plan.

(This commentary originally appeared on Real Money Pro at 7:00 a.m. on Oct. 13. Click here to learn about this dynamic market information service for active traders.)

Apple, Alphabet is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells AAPL and GOOGL? Learn more now.

More of What's Trending on TheStreet :

At the time of publication, Ponsi was long AAPL, GOOGL, MCD, TXRH and SONC, although positions may change at any time.

Action Alerts PLUS, which Jim Cramer co-manages as a charitable trust, is long AAPL and GOOGL.

More from Currencies

Bitcoin Today: Prices Close to Flat in Low-Volume Trading

Bitcoin Today: Prices Close to Flat in Low-Volume Trading

Markets Wobble as U.S. Readies More China Tariffs

Markets Wobble as U.S. Readies More China Tariffs

Watch These Two Crypto Experts Fiercely Debate the Future of Regulation

Watch These Two Crypto Experts Fiercely Debate the Future of Regulation

Bitcoin Today: Prices Attempt to Rally Following Early Weakness

Bitcoin Today: Prices Attempt to Rally Following Early Weakness

Ether Prices Rally After SEC Director Says He Doesn't Consider It a Security

Ether Prices Rally After SEC Director Says He Doesn't Consider It a Security