The seven-month stock rally for Home Depot Inc. and Lowe’s Cos. could be at risk as the U.S. housing market stalls.

The Standard & Poor’s 500 Home Improvement Retail Index, made up of these two companies, has risen 34 percent since June 13, while the S&P 500 Index has climbed 2.9 percent. The ratio of these indexes is near an all-time high, as the home-improvement group closed at 1,061.19 Thursday and the benchmark index was at 1,992.67.