IT IS not easy to have faith in the rally in emerging-market currencies that has taken place since February. The ones that have risen most in recent weeks are typically those—the rouble, the real and the rand—that had lost most ground since May 2013, when the emerging-market sell-off began in earnest (see chart 1). What is there to like about Russia, Brazil and South Africa, with their wilting economies and dysfunctional politics?

The proximate causes of the rally are clear. One was the fading of fears for China’s economy. At the start of 2016 capital appeared to be fleeing China at a rapid rate, in a vote of no confidence. The yuan seemed in danger of losing its moorings against the dollar, raising fears of a round of competitive devaluations across Asia and beyond. Views changed around the time of the meeting of the G20, a club of big economies, in Shanghai in February. Informal pledges by the Chinese authorities not to let the economy slide were backed up by stimulus policies, including a big budget deficit and faster credit growth. Tighter capital controls stemmed the outflows from China. Prices of scorned commodities, such as iron ore, surged at the prospect of Chinese construction. Currencies of raw-material exporters rose too.

A second trigger was a change of heart by the Federal Reserve. In December it raised its main interest rate for the first time in a decade and suggested four further increases were likely in 2016. It has since backed away from these hawkish forecasts. Real interest rates, measured by the yield on inflation-proof bonds, have fallen to 0.14%. The dollar has slumped against even rich-world currencies. No wonder the high yields on offer in Brazil, Russia and other emerging markets are so tempting to rich-world investors, says Kit Juckes of Société Générale, a French bank.

The improved conditions for emerging markets may prevail for a while, but not indefinitely. China’s policy of loose credit only adds to its alarming debt pile (see article). The Fed will eventually resume tightening. Even so, there is a bit more to the emerging-market rally than just a favourable backdrop.

To understand why, go back to May 2013, the start of the “taper tantrum”, when hints from the Fed that its bond-buying would soon tail off prompted a stampede out of emerging markets. Before the Fed’s shift their trade deficits had been growing, leaving them more reliant on foreign borrowing to fill the gap. So when the exodus got going, the hardest hit were economies that depended most on foreign capital.

Jump forward to 2016, and the picture is very different. Emerging markets in aggregate are running a trade surplus. That is the case even if China’s bumper surplus is excluded (see chart 2). What is more, the countries whose trade balances have adjusted the most, Brazil and Indonesia, are among the best recent performers, says Paul McNamara of GAM, a fund manager. True, the improvement is the result of crushed demand for dearer imports, not a revival in exports. But this is a typical pattern of adjustment: imports fall first; exports recover later.

Sceptics counter that there is little that links the countries whose currencies have bounced recently. Some are oil producers. Others export different commodities. A few do neither. Some have made painful changes. Many have skirted them. “Even the dogs have rallied quite hard,” sniffs another fund manager. The quest for a Teflon-coated emerging market is probably futile. If investors become chary of risky assets again, even those with half-decent fundamentals will get dumped. Still, some traps seem avoidable. China is one obvious snare. Renewed trouble in its economy would hurt commodity producers through lower prices, but probably will not lead to a further drop in investment in drilling and mining, which has already been crushed. At greater risk, perhaps, are the fairly rich economies that supply China with half-finished or finished goods—Singapore, South Korea and Taiwan—though all have ample protection in the form of trade surpluses and foreign-exchange reserves. A second concern is interest-rate increases in America. So few of them are expected that even a turn in a mildly hawkish direction by the Fed might give the dollar a lift. Countries with biggish current-account deficits, such as Colombia and South Africa, or big stocks of dollar debt, such as Chile, seem most vulnerable. Turkey is at risk on both counts, as well as from political upheaval, which caused the lira to slump this week. Manoj Pradhan of Morgan Stanley stresses a third potential pitfall: overly rapid credit growth. China, which has huge and still-growing debts, is Exhibit A. Malaysia, Thailand and South Korea may also face credit hangovers. They all have strong trade links with China, too. Once these traps are taken into account, there are just a handful of emerging markets to feel fairly sanguine about. Russia has already endured a deep recession. It has a cheap currency, a current-account surplus and a capable central bank. Better yet, with inflation likely to fade, interest rates there are expected to fall this year.

India is a net commodity importer; it is tied only loosely to China’s economy; it has a smallish trade deficit and credit has been slowing for years, even if its banks are weighted down by souring corporate debts. Indonesia has similar merits. Mexico’s economy has been a let-down (in part because America’s economy also has), but it has fewer weak links than its peers. It is testimony to the still parlous state of emerging markets that such lukewarm investment cases are the best on offer.