Steel Dynamics (STLD -0.64%) has been a welcome exception to this year's bear market. Whereas the S&P 500 is down 14.5% year to date, shares of the metal supplier are up to the tune of 78%, reaching a record high this week.

In-the-know investors know why. Although metal prices have tumbled since late last year, demand hasn't. Global supply has simply been crimped due to factors like Russia's invasion of Ukraine and COVID-19-curbing lockdowns in China, buoying prices for producers that can supply it. Steel Dynamics is subsequently enjoying tremendous pricing power and profits. Shareholders have enjoyed the same.

A bar chart and feverline chart show Steel Dynamics fical results for the past several years.

Data source: Thomson Reuters. Chart by author.

Nothing cures a supply/demand imbalance like time, though, and we're nearing a point in time where both are about to be flipped for all the major metals.

In other words, this may be an "as good as it gets" moment for Steel Dynamics shares.

The backdrop is changing fast for Steel Dynamics

Most segments of the global economy are cyclical. The materials businesses are particularly sensitive to economic ebbs and flows, however. Their profit margins are typically thin, and with most materials being simple commodities, competition can come from anywhere.

And that's the first concern current and would-be Steel Dynamics shareholders should consider here -- the supply/demand dynamic that's proven a boon for the business in 2022 could readily reverse in 2023.

This wasn't the case just a few months ago. Then, the world was seemingly pulling itself out of the pandemic blues and industry was revving its engines again. A combination of rising interest rates and rising prices took a slow but steady toll on the global economy, though ... and on the steel market itself. Industry association World Steel now estimates total steel consumption will slide by nearly 2% in 2022 and will essentially be flat in the coming year. That so-so expectation for 2023 also largely depends on strong demand from U.S. automakers. If the economy slips into a full-blown recession, consumers may show little interest in buying new cars. Fitch is voicing a similar concern regarding the impact of an increasingly likely recession, here and abroad. Any and all of it prospectively works against already-struggling metal prices.

A feverline shows the London Metal Exchange hot roll coil steel price history for the past several years.

Data source: London Metal Exchange and Platt's. Chart by author.

At the very same time, producers are cutting back on their planned output. The World Steel Association reports October's total steel output fell 3% from September's levels due to concerns about the accumulation of surplus inventories. Look for more of the same production cuts ahead, too. 

It's admittedly a bit counterintuitive. Even if demand is cooling, there's room to restore some inventory levels here. Cutting back on production now seems to do anything but increase the world's stock levels of the important metal.

There's a method to the apparent madness, though.

In light of the logistics and relatively long lead times of mining and refining metal, steel companies are collectively careful not to overproduce or underproduce relative to future demand. And, given how they're in the business, their read on the matter is likely to be a prescient one. If they see a potential glut on the horizon, there's apt to be one on the horizon. 

Underscoring this concern is investment bank Orient Securities' expectation for a 3.5% increase in China's iron ore output for the coming year. This is ore that eventually becomes steel. If that's the shape of things to come elsewhere, the recent stabilization of the world's steel stock levels is a legitimate worry. It could mark the beginning of a new inventory swell that further undermines steel prices.

Right company, wrong time

Don't misread the message. Steel Dynamics will survive any headwind stemming from the brewing swings not just in demand, but in supply as well. It's clearly survived them in the past.

That doesn't mean the stock won't once again suffer from the industry's perpetual cyclical swings, however.

Whether or not the world slips into a full-blown recession, economic weakness is afoot. If we're not at a peak for producers' profits, we're at least apt to be near one. At the same time, it may already be too late for curbed output to stave off a near-term expansion of the world's steel inventory levels.

So, to answer the question, no -- long-term investors shouldn't buy Steel Dynamics at its all-time high. They should wait until the impending supply/demand/pricing dynamic runs its course and then step in. Just realize it's a dynamic that could take months or even years to fully play out.