Indian stocks swung between gains and losses on Thursday after the International Monetary Fund slashed its growth outlook for the country and forecast a deeper global recession, with gains in consumer and pharma stocks offsetting losses.

The IMF on Wednesday evening predicted the Indian economy would contract by 4.5% in 2020. It also expects global output to shrink 4.9% this year, a sharper fall than the 3% contraction predicted in April.

sensex nifty
A man walks past a screen displaying news of markets update inside the Bombay Stock Exchange (BSE) building in Mumbai, February 6.Reuters

The NSE Nifty 50 index rose 0.1% to 10,320 and the benchmark S&P BSE Sensex was also up 0.1% at 34,924.05 as of 0506 GMT. Both the indexes fell 1% early in the session.

"What is compensating the growth downgrades and surge in virus cases is liquidity. There is hope that the central bankers will continue liquidity infusing policies," said Mayuresh Joshi, head of equity research at William O'Neil India in Mumbai.

Nifty fast-moving consumer goods index rose 1.1%, pharma index gained 0.53%

"When markets turn volatile, investors turn to defensive stocks like pharma and consumer," he added. The Nifty fast-moving consumer goods index rose 1.1%, while the pharma index gained 0.53%.

The FMCG and pharma indexes have gained 3.8% and 1.7% so far this week, respectively, compared with a 0.6% gain in the heavyweight Nifty Bank index. Investors were also closely monitoring a surge in coronavirus cases globally, analysts said.

Sensex, Nifty
A broker reacts while trading at his computer terminal at a stock brokerage firm in Mumbai.Reuters

Domestic coronavirus virus cases surged over 473,000, while some U.S. states reported record increase in new cases on Wednesday and Australia posted its biggest daily rise in infections in two months. Indian indexes are expected to be volatile on Thursday ahead of the monthly expiry of futures and options contracts.

Shares of GAIL (India) Ltd rose 5.28% and were the top gainer on the Nifty 50 index after the company posted a surge in March quarter net profit. Asia's stock markets slipped, bonds rose and the U.S. dollar was firm on Thursday.