Chinese investors, well known for their impulsive trading habits, appeared composed in the wake of Republican Donald Trump’s shock presidential victory, as they drew lessons from the sell-off after Brexit.

Instead of joining the global stampede for the exits, many mainland investors pounced on battered stocks in Hong Kong during Wednesday’s sell-off. Now, they are strategizing how to profit from the president-elect’s China policies – such as shorting Chinese exporters or buying agriculture stocks.

“Brexit has taught us how to deal with black swans,” said Robert Di, Shanghai-based founding partner of investment firm RPower Capital, referring to the surprising British vote to leave the European Union that triggered panic selling worldwide, only to be followed by sharp rebounds.

“A lot people were caught unprepared by Brexit, but this time, many had been waiting for that sort of golden buying opportunity, which is why it’s so short-lived.”

Di said he increased holdings in Hong Kong-listed tire & rubber maker Xingda International Holdings on Wednesday at the depth of the Trump-triggered market tumble, and is also considering shorting Chinese exporters, which are vulnerable to Trump’s protectionist policies.

The bet has proved profitable so far as Hong Kong stocks recovered most of their losses on Thursday. Sentiment was much calmer on the mainland, where stocks dropped just 2% on Wednesday, and quickly recovered lost ground on Thursday, climbing to a fresh 10-month high.

Di’s view was echoed by Zhu Lijie, analyst at Qilu Securities Asset Management, who sees investment opportunities in the “Trump panic.”

“At that very moment of Brexit, the world shuddered, but it was not long before all asset prices recovered lost ground.”

Betting on a repeat of such a rebound, mainland investors spent roughly 5 billion yuan ($736.5 million) buying Hong Kong stocks on Wednesday via the Shanghai-Hong Kong Stock Connect channel.

In contrast, net inflows had been negligible during the previous month, which traders attributed to concerns over the U.S presidency and a looming Federal Reserve rate hike.

Ma Hong, general manager of Shanghai TopFund Investment Management, said it was worthwhile hunting for bargains in Hong Kong as shares there are more cheaply priced than their mainland peers. Furthermore, they will benefit from a strong dollar, to which the Hong Kong currency is pegged.

There are restrictions on purchases of property and foreign currencies in China, so buying Hong Kong stocks through the Connect “is a good way to hedge against yuan depreciation risks,” Ma said.

Some Chinese investors are already designing strategies to bet on sectors that will benefit the most from Trump policies.

Ke Haidong, fund manager at First Seafront Fund Management, said China’s agricultural stocks may be worth investing in. He foresees the possibility of retaliatory Chinese tariffs on U.S. imports if Trump implements his protectionist policies, thus pushing up prices of agricultural products in China.

Investors are also betting the infrastructure sector could benefit from Trump’s foreign policies, which would make it easier for Beijing to push its “One Belt One Road initiative,” wrote Julian Evans-Pritchard, China Economist at Capital Economics.

“Declining U.S. influence would give China more freedom to shape the regional landscape,” he said.

“The One Belt One Road initiative gives China a means to leverage closer political links to promote closer economic integration.”

Thomas Poullaouec, managing director of State Street Global Advisors Asia, agreed.

“Overall, I will have the argument that this could be positive for China in its global outreach,” he said.

“Because it’s unlikely that many countries will make friends with Trump, putting aside Putin … so it may be positive for China in its global efforts.”