The BSE Sensex and Nifty extended a record-setting winning streak on Wednesday, as software exporters such as Infosys rallied on strong US economic data, while continued foreign buying and falling oil prices also helped the gains.
A fall in Brent crude prices to 16-month lows and recent supportive economic data at home such as better-than-expected 5.7 per cent GDP (gross domestic product) growth in the June quarter are also reinforcing investor optimism.
The gains also tracked a rise in global stocks after Ukraine said it reached a ceasefire agreement with Russia, despite conflicting reports from the Kremlin.
Foreign investors continued to buy Indian stocks ahead of a crucial European Central Bank meeting on Thursday, which is widely expected to provide further stimulus for revival, thereby aiding liquidity in the financial markets.
Foreign portfolio investors bought shares worth Rs 673 crore ($111 million) on Tuesday, taking their total purchase to over $13 billion so far this year.
"Political and economic changes have led to a positive trend in Indian equities which should continue. Also, India stands out in the world due to its strong domestic growth story," said Nirakar Pradhan, chief investment officer at Future Generali India Life Insurance.
The Sensex touched its fourth consecutive record high of 27,225.85, before ending 0.45 per cent higher at 27139.94. The Nifty rose as much as 0.73 per cent to mark its third straight record high at 8,141.90. It closed up 0.39 per cent at 8114.60.
Software stocks gained after data showed US manufacturing activity hitting a nearly 3-1/2-year high last month and construction spending rebounding strongly in July, providing signs the economy entered the third quarter on a strong footing.
Meanwhile, oil retailers gained after Brent crude slumped to 16-month low on Tuesday. Prices rebounded on Wednesday but ample supplies and lingering demand worries limited the rally.
Hindustan Petroleum Corp gained 1.3 per cent, Indian Oil Corp rose 1.6 per cent, while Bharat Petroleum Corp ended 0.13 per cent higher.
Carborundum Universal ended 2.6 per cent higher after earlier marking a record high of Rs 217.35 as HDFC Mutual Fund raised stake in the abrasives maker to 4.61 per cent from 4.08 per cent, via a block deal on Tuesday. Tata Motors gained as much as 2.8 per cent after a slew of rating upgrades, citing valuations and improving outlook for its luxury car making unit Jaguar Land Rover.
Among the stocks that fell, Cipla lost 0.7 per cent after surging to a record high of Rs 575 on Tuesday.