What happened

The homebuilding sector got a big boost from multiple pieces of major economic news in June. The bullish information rippled throughout the sector, and building supplies stocks were some of the biggest gainers as a result. Owens Corning (OC -1.10%) charged ahead 22.7%, while Trex (TREX -0.93%) moved 27.7% higher, according to S&P Global Market Intelligence.

So what

Owens Corning manufactures fiberglass products, primarily for roofing and insulation. Trex produces wood-alternative composite products used primarily in decking and railing.

Demand for building products like these can be very sensitive to economic cycles. The number of people who build or improve a home can dissipate quickly if employment drops or interest rates climb too high, which winds up impacting housing stocks.

Builders working on the roof of a house.

Image source: Getty Images.

In recent quarters, we've been dealing with an uncommon combination of the two. The Federal Reserve has been shrinking the money supply to combat inflation, which has caused interest rates to rise quickly across the economy. Mortgage rates rose from under 3% to 7% in 2022, discouraging buyers.

Simultaneously, consumer sentiment sagged amid highly publicized layoffs and ongoing inflation pressures. People are less likely to purchase homes if they feel when household income is uncertain. These factors exerted downward pressure on all stocks associated with homebuying or building over the past year and a half.

30 Year Mortgage Rate Chart

30 Year Mortgage Rate data by YCharts

Last month, the Fed ignited some optimism by pausing interest rate hikes for the first time in 15 months. This raised the likelihood of more accommodating economic conditions for homebuilding in the near future, sending stocks in that sector higher. This news was followed by data on housing starts and building permit, which showed that new homebuilding activity hit the highest level in a year.

US Housing Starts Chart

US Housing Starts data by YCharts

Policy and economic indicators justified renewed optimism in the medium term for homebuilders and building supplies stocks. Nearly the whole sector outpaced the market in general.

Now what

After months of concerns that monetary policy would trigger a recession, investors are starting to hope that we could have a relatively soft landing from all the pandemic-related disruptions. At the same time, it's hard to say that the economic risks are entirely behind us following the June data.

Last month's existing home sales were down 20% year over year, and mortgage rates are still at the highest level in nearly 20 years. Employment and housing demand both seem to be holding up relatively well, given the potential drags, but a recession isn't out of the question.

Following last month's gains, Trex's forward P/E ratio is around 35, resulting in a PEG ratio over 2. Owens Corning's forward P/E ratio is much lower at 11.3, reflecting nearly flat growth that's anticipated over the next few years. Trex has some room to fall if economic conditions deteriorate, while Owens Corning has modest upside if housing booms. Both stocks offer long-term upside, but the June surge makes it hard to call either undervalued.