(Bloomberg) -- Hong Kong dollar bears are abandoning their short bets, stoking the currency’s longest rally in more than five years.

The currency rose as much as 0.13% to 7.7867 versus the greenback on Monday, nearing its strongest level since mid-2017. Supporting the advance are bets that borrowing costs will remain elevated versus falling U.S. dollar rates, as banks hoard cash for year-end regulatory checks. An easing of trade tensions between China and the U.S. has also helped, with foreign funds snapping up stocks in Hong Kong.

It’s all sounding the death knell for the Hong Kong dollar carry trade, a once-popular strategy that had in the past two years repeatedly pushed the currency to the weak end of its band. While hedge funds profited and forced the central bank to defend the peg, its legacy is a volatile local dollar that is increasingly vulnerable to shifts in demand for cash. The city’s shrinking interbank liquidity pool means large share sales and window dressing cause spikes in interest rates and dramatic moves in the currency.

“The currency is benefiting from the unwinding of short positions and capital inflows into the stock market,” said Tommy Ong, managing director for treasury and markets at DBS Hong Kong Ltd. Still, “it will fluctuate between 7.78 and 7.82 in the coming three months without touching either side of its trading band because interest rates won’t fall sharply next year and the inflows won’t be sustainable.”

While the former British colony keeps its currency on one of the world’s tightest leashes, the Hong Kong dollar is no stranger to painful stampedes. On Sept. 21 last year, the exchange rate suddenly surged 0.6% -- the most in 15 years -- for no apparent reason apart from mildly higher borrowing costs.

Some signs of tighter liquidity are appearing now. The Hong Kong dollar’s one-month interbank funding costs, known as Hibor, jumped 9 basis points to 2.6% Monday, the highest level in a month. But the key factor supporting a year-end rally this time is the gap between local interest rates and those for the U.S. currency. Traders earned more on Hong Kong dollar assets versus those denominated in the greenback for 27 sessions as of Friday -- the longest stretch in four years.

The Hong Kong dollar rate has been elevated since last month, with the premium over its U.S. counterpart briefly touching the highest since the 1990s. That came as Chinese e-commerce giant Alibaba Group Holding Ltd. prepared to list in the city, mopping up liquidity as investors set aside cash to buy the shares.

Months of political unrest are also complicating the situation in the money and currency markets, according to Cliff Tan, head of global markets research for East Asia at MUFG Bank Ltd. That could offset some fund inflows, he said.

To contact the reporter on this story: Tian Chen in Hong Kong at tchen259@bloomberg.net

To contact the editors responsible for this story: Sofia Horta e Costa at shortaecosta@bloomberg.net, Philip Glamann

©2019 Bloomberg L.P.