Investors should look into buying the Malaysian ringgit, according to J.P. Morgan.

The Malaysian currency could do well if a trade deal between the U.S. and China materializes, Jonathan Cavenagh, head of forex strategy for emerging markets Asia at the investment bank, told CNBC on Wednesday.

"We think that U.S.-China trade tensions are going to help put a floor under things like crude palm oil prices, because China's going to be importing more of those ... commodities from the U.S," he said.

Some reports have suggested that China may buy more commodities from the U.S. as part of their tariff agreement. If true, Malaysia — one of the world's top palm oil exporters — will benefit from it, said Cavenagh.

"We think the positive U.S-China trade outlook, and if we do see those reduced tensions coming through, that could still benefit the ringgit from current levels," Cavenagh added.

Secretary of State Mike Pompeo said Monday that he thought Washington and Beijing were "on the cusp" of reaching an agreement that would end the trade skirmish.

That positive trade development will help Malaysia's current account balance, Cavenagh pointed out. More demand from China will boost oil prices, and lift the Southeast Asian nation's current account surplus since it's a palm oil exporter.

A current account surplus indicates a nation is a net lender, and typically supports a country's currency.

A Goldman Sachs report this week also supported the view that China may be buying more commodities from the U.S. if a trade deal goes through.

According to that report, increased purchases in several areas are on the negotiating table, and Beijing may be contemplating more energy purchases such as crude oil and LNG — or liquefied natural gas.

"We expect that China would focus much of its total purchase commitment on agricultural and energy commodities," Goldman said in its report.