When the International Monetary Fund (IMF) and the US dollar go head to head, the dollar wins.

On October 6, in the second of its “World Economic Outlook” reports for 2010, the IMF was bullish on commodities, especially on base metals such as copper and tin. (For the IMF’s read on growth in the global economy in the remainder of 2010 and in 2011, see this post.)

“Commodity prices are projected to remain high by historical standards over the medium term, with risks tilted to the up side.” In other words, we think commodity prices are going up, the IMF said, and the odds say that if we’re wrong, it’s because prices will go up more than we project.

“The current era of higher scarcity, rising metal price trends, and a balance of price risks tilted toward the up side may continue for some time,” the report said.

Not surprisingly that day, tin for delivery in three months rose by 3.1% on the London Metal Exchange to a record high of $26,790 a metric ton, before dropping back slightly at the close. Copper climbed to $8,326 a metric ton, the highest price since July 2008.

The next market session, however—just one day later—copper was down 2.1%, gold is down 1%, and silver is down 2%.

What happened? The IMF met a rally in the US dollar, and the dollar won.

I still think the medium-term trend for the US dollar is downward, but in the very near term (the next few weeks), the dollar looks like it is staging a technical rally from an extremely oversold position.

What can we expect from the dollar now? A replay of the dollar’s oversold bounce in early August seems a reasonable guide.

Back then, the dollar had been falling like a stone since mid-May. Finally the currency got an oversold bounce in the first week of August. That bounce ran until August 23 or so before the dollar resumed its fall.

If that pattern repeats itself, investors can look for something like a dollar bounce of two to three weeks. And that would take us to something like October 21 to October 28 before the medium-term downward trend reasserts itself.

Note that this year, several of the stock market’s strongest moves have been connected to the dollar. The top of the market in April coincides, roughly, with an end to the falling dollar. The rally that began in late August coincides, roughly, with the end of the dollar bounce and a resumption of the dollar’s fall.

Commodity prices and the prices of commodity stocks are the biggest drivers of that connection. When the dollar is falling, commodity prices (this year anyway) climb and the price of commodity stocks goes up with them. That sector is certainly big enough to get stocks moving up. If investors jump into other sectors, looking for other ways to participate in a climbing market, we get the kind of rally that covered most of September.

If I’m right about this—that we’re seeing a two- to three-week dollar bounce—and the IMF is right (not in the short term, perhaps, but about the upward direction of commodity prices in the medium term), then investors ought to use weakness in commodity stocks as a buying opportunity in October.

Watch carefully, though: It’s hard to predict when an oversold market will bounce, and it’s just as hard to predict how long an oversold bounce will run.

Full disclosure: I don’t own shares of any company mentioned in this post in my personal portfolio.