After suffering through an extended bout of bearishness, beaten-down China shares in unloved sectors are climbing and analysts expect the rally can continue.
"It's a dash for trash," Viktor Shvets, head of strategy research for Asia at Macquarie, told CNBC. "Stocks and sectors that were sold off and also that don't really have a long term future – that's the banks, the real estate, the SOEs [state-owned enterprises] – those are the areas that are running."
The recent rally has been fairly strong, with the up around 9 percent from its late-April lows, although it is still down more than 36 percent from its levels five years ago. The HSCEI, an index of Hong Kong-listed H-shares, is up around 20 percent from its late-April lows.
China's markets have been undermined by slowing economic growth as well as concerns over bad debts, shadow banking and property sectors. But economic data has been improving in recent months, pointing to stabilization in the world's second largest economy. Second quarter growth came in at 7.5 percent year on year, better than expectations and the broad consensus is that outlook for the second half is upbeat, helped by a series of"mini stimulus" measures from Beijing.
While the entire market may be valued at only eight to nine times earnings, but the stocks people want to buy, such as technology and consumer discretionary plays, are trading at much higher valuations, sometimes more than 25 times earnings, Shvets said.
That's why investors are turning to unloved sectors. Banks, for example, may be permanently stuck trading at below book value, but they were trading at less than 0.7 times book value and can still rally as high as 0.9 times, Shvets said.
He expects the rally can continue. "Most investors tend to believe the structural story of China is so impaired that China will be facing significant problems going forward. And I don't disagree with that. I think there are significant structural problems,"Shvets said, but he noted, "China has gotten so sold down that it really doesn't need to succeed. All it needs to prove is that it doesn't fail."
Others also expect the "trash" sectors to continue to rally. "In the very short term, in terms of a tactical trade, you need to be buying value," said Guy Stear, head of research for Asia at Societe Generale. "The value shares are in areas where you'll naturally be somewhat nervous about the sectors and companies," such as building materials and industrials.
In the short term, "there's been a bit of easing in terms of policy, there's been an improvement in terms of PMI [Purchasing Managers'Index] figures, so you can expect to see the stocks which have been most bombed out doing the best," Stear told CNBC.
There's another reason stocks can keep heading higher: Stear also noted that China equities tend to perform better in the second half of the year,and he expects the H-share index could head up toward 11,500. The index closed Monday at 11,072.
Others also believe the government's steps starting from May to loosen policy were a game-changer for the mainland's equity market.
"We were all talking about doomsday scenarios in China – trust defaults, borrowing rates shooting up especially for lower rated corporates,"said Binay Chandgothia, portfolio manager at Principal Global Investors. "With them suddenly changing tack and pumping liquidity into the system, it implied a much better growth outlook."
Chandgothia also sees value in unloved sectors as the growth outlook improves, such as the energy, financial, industrial and materials stocks, but adds that the rally won't extend indefinitely.
Read More Investing in China: A Catch-22?
"There would be a time when you realize the additional impetus thrust into the economy by way of easy monetary policies will come to an end,"he told CNBC. It's a signal the market has given before, such as in 2007, at the market peak, when shares were trading at 40 times earnings, he noted.
"Forty times was clearly not sustainable. It required the economy to grow at 15 percent per annum almost until eternity without any systemic issues," he said. "Similarly, you feel an eight times price-to-earnings ratio is probably a bit too cheap for the Chinese economy."
—By CNBC.Com's Leslie Shaffer; Follow her on Twitter @LeslieShaffer1