Indian stock markets closed up marginally on Wednesday following global cues of optimism of a solution emerging in the euro zone.

The NSE closed at 5,062.6, up 23 points (0.47 per cent), while the BSE closed 72 points up at 16,877 (0.43 per cent).

The benchmark indices were in the green throughout the day which was volatile. The volatility index India Vix was up six per cent and closed at 26.46.

“S&P’s threat of a wholesale downgrade seems to have worked wonders as the street is expecting a concrete direction towards a possible solution to euro zone’s debt crisis,” said the Head of Research of a multinational brokerage.

RCom, Wipro, HCL Tech, Infy and RInfra were the top five Nifty gainers, while NTPC, Bharti Airtel, Coal India, Sun Pharma and Sesa Goa were the top five losers.