What happened

Shares of Trex (TREX 1.25%) dropped 13.6% last month, according to S&P Global Market Intelligence. The building materials leader endured a sell-off thanks to some macroeconomic data that hurt the outlook for homebuilding activity.

So what

Trex published an impressive quarterly earnings report to start August. The company surpassed Wall Street's estimates for sales and profits, and analysts revised their forecasts higher. Demand was stronger than anticipated, and the company capitalized on top-line strength by slashing expenses to boost income. Trex hasn't published meaningful company-specific news since then, but the stock has struggled against a barrage of troubling economic news that wiped out the optimism generated by the quarterly report.

A carpenter using a drill to place composite boards on a deck.

Image source: Getty Images.

Homebuilding data took an unexpected, sharp turn downward in August, and that data hit the headlines in September. New housing starts dropped 11% month over month and 15% year over year. This represented the lowest level since June 2020 and was significantly below analyst expectations. Demand for Trex products isn't limited to newly built homes but is a strong indicator.

High interest rates are putting pressure on consumers, seriously impacting the housing sector and the automotive and consumer durables industries. The Fed's September commentary suggested that rate cuts were further away than many investors had hoped, reversing much of the optimism built up earlier in the year.

These factors put consistent downward pressure on Trex stock last month, as well as many of its peers and stocks from related industries. Its chart was conspicuously similar to Home Depot's and the iShares US Home Construction ETF. That's a strong signal that Trex's performance was driven by external factors.

TREX Total Return Level Chart

TREX Total Return Level data by YCharts.

Trex doesn't pay a dividend and has a relatively high price-to-earnings (PE) ratio, leading to a 1.4 beta and higher volatility than many of its peers. As a result, it sustained bigger losses than other housing stocks last month.

Now what

Trex has strong long-term catalysts, but the medium term is less certain. Demand for these building materials is highly cyclical, and the macroeconomic environment is throwing a number of difficult headwinds at the company right now. That's translated to some of the company's weakest revenue growth and gross profit performance in years.

TREX Revenue (Quarterly YoY Growth) Chart

TREX Revenue (Quarterly YoY Growth) data by YCharts. YoY = year over year.

The past few months have presented a more attractive buying opportunity for Trex bulls. Its forward PE ratio at 33 is the lowest since June, though it's still well above the recent low of 24. The stock will likely remain volatile over the next few quarters. However, there should be an opportunity for strong returns if the company realizes its potential over the next few economic cycles.