* Bank Negara clamped down on offshore ringgit trading
* Foreigners holding half of Malaysian bonds had fled
* Recent data shows they're slowly coming back
* Improving economy, stronger ringgit are draws
* Central bank has also improved onshore RM trading
SINGAPORE, June 1 (Reuters) - Foreign portfolio investors say they are coming back to Malaysia's markets, six months after many of them revolted against the central bank's crackdown on the offshore ringgit trading market.
Foreigners, who had held about half of the outstanding Malaysian government bonds, fled the market between November 2016 and March this year after Bank Negara Malaysia said they could no longer trade in ringgit non-deliverable forwards (NDFs). These are offshore contracts used to hedge exposure to the ringgit.
Bank Negara maintained its ban on ringgit trading in the NDF market, which it considers opaque, volatile and subject to abuse, even as it bled foreign exchange reserves defending the falling currency and as bond yields rose. Foreigners withdrew at least $14 billion from Malaysia's bond markets between November and March.
By April, however, about 10 percent of that money had come back into Malaysian government and central bank bonds. The data for May, due next week, is expected to show even more foreign outflows have returned.
"A few weeks ago, when we saw this pattern of all big real money managers being very very underweight Malaysia, we saw that as a good time to be slightly contrarian," said Jean-Charles Sambor, deputy head of emerging markets fixed income at BNP Paribas Investment Partners in London.
"Now we see that not only is the central bank willing to develop a credible onshore market, most real money guys are looking at ways to access the bond market. We see new counterparties and we think it's heading in the right direction."
IMPROVING ONSHORE MARKET
Fund managers say, however, hedging exposures to the ringgit is not as easy as in other emerging markets, which offer the alternative of liquid offshore derivatives markets with barely any regulatory oversight.
Still, Bank Negara has worked to improve onshore trading. Malaysian exporters have been asked to bring home their earnings and foreigners are allowed to hedge all their exposures.
Bank Negara's FX reserves data shows it has pumped about $19 billion worth of cash into the foreign exchange trading system to improve liquidity.
"The worst of the outflow pressure seems to be behind us now," Deutsche Bank analyst Sameer Goel said in a note to clients this week, adding that the improving economic environment was another reason to buy ringgit bonds.
GDP growth in the first quarter of 2017 hit 5.6 percent over the same period a year earlier, driven more by a pick-up in domestic demand than the modest recovery in the price of the oil and gas that Malaysia exports.
Citi analysts said they were bullish, mainly because the ringgit was cheap and the authorities seemed inclined to let it appreciate.
Another fund manager, Western Asset Management, shifted its allocation to Malaysian local currency bonds to neutral from modestly underweight early this year.
"We see yields, around 4 percent, as being attractive so we've slowly scaled back up and that's probably in line with the rest of the market," said Desmond Fu, an analyst at Western Asset Management.
Steve Ellis, a portfolio manager at Fidelity International, said he had been underweight ringgit bonds in late 2016 and early 2017 but has now changed to a neutral position.
ASIAN FINANCIAL CRISIS
Malaysia's distrust of the offshore currency derivatives markets is rooted in the Asian financial crisis.
It forged its own path then too, as emerging markets suffered massive capital outflows and currency depreciation, pegging the ringgit to the dollar for seven years from mid-1998. Kuala Lumpur rebuffed aid from the International Monetary Fund after rejecting the IMF's conditions on restructuring its economy and emerged from the crisis stronger than its peers.
Malaysia's latest salvo has brought the offshore ringgit NDF market to a standstill, traders said, while the currency is slowly beginning to strengthen again onshore.
The ringgit has risen 5 percent this year and was trading at 4.28 per dollar at midday on Thursday compared with around 4.20 last year before the NDF directive was announced.
Currency reserves at $97 billion are sufficient to pay for about eight months of imports. But Bank Negara still has a $19 billion liability on its forward position it needs to recoup after pumping liquidity into the forex trading system.
To win the war conclusively, Bank Negara needs foreign investors to return in force, and that hasn't happened yet.
Foreigners held 51.6 percent or $43 billion of government bonds in October last year. That proportion fell to 38 percent in March and is now just up to 40 percent.
"I don't really see that suddenly fund managers have become exceptionally enthusiastic about Malaysian bonds," said Desmond Soon, head of investment management for Asia ex-Japan at Western Asset Management. "It's just that there's a move from substantially underweight to a more neutral position."
(Editing by Bill Tarrant)