As India's stock markets soar to record highs last week, shares could be in a sweet spot that has prompted one emerging market investor to consider the asset class a "safe haven."

India's benchmark S&P Bombay Stock Exchange (BSE) ended trade on Friday up 0.95 percent at 37,336.85, having hit a record high for the fourth day in a row. Meanwhile, the broader NIFTY 50 continued its rise, ending up 0.99 percent higher at 11,278.35 after hitting an all-time high of 11,283.40. For the week, the NSE index gained 2.44 percent, its biggest gain since the week ending March 17, 2017, according to Reuters.

Performance was boosted by strong corporate results as firms reported their second-quarter figures.

The positive sentiment contrasts with the dark cloud of uncertainty that has hung over global markets as the U.S., China and Europe grapple with a war over import taxes.

It is thanks to a combination of factors that India is a "relative safe haven for equity investors," according to Jon Harrison, managing director for emerging markets macro strategy at research firm TS Lombard.

"India is a relatively closed economy," he explained to CNBC via e-mail, adding that the country was "less involved in regional supply chains than some of the more high-tech Asian economies." The World Bank puts India's export figure for 2017 at 18.9 percent, meaning that it is more cushioned from fluctuations in international trade flows than, say, China, South Korea and Vietnam.

In addition, India may benefit as investors turn away from China. "India is the other large Asian equity market, so investors who want to maintain an exposure to Asian equities but fear the impact of the trade war would favor India over China," Harrison said.

Domestic politics could also favor the equity market. Acting ahead of an election next year, Indian Prime Minister Narendra Modi's government has increased state support for farmers and is on a push to extend social security, both strategies which could boost consumer spending.

India is predicted to be the world's fastest-growing major economy this year, with gross domestic product set to increase by 7.3 percent in 2018, according to the World Bank.

Nonetheless, Harrison added the caveat that India could only be considered a safe haven in what is "a very negative overall environment for emerging market assets."

Roger Jones, head of equities at asset manager London and Capital, echoed Harrison's thinking. India is a "domestic demand driven economy," he told CNBC via e-mail, adding that "foreign direct investment remains strong and is unaffected by trade threats."