Heavy foreign buying continued to underpin the recent rally with overseas investors buying Indian shares worth Rs. 385 crore on Tuesday after a totalling $3.3 billion in March.
Stocks also tracked higher global shares on Wednesday as investors focused on the good news in a mixed bag of international economic data.
U.S. jobs data due on Friday and India's general elections, beginning this month, are widely expected to drive shares in the near term.
Investors see India's main opposition Bharatiya Janata Party, perceived more business-friendly, holding higher chances of coming to power.
"Practically positions can be kept but strategically they should be shifted or pared after such a strong rally," Aneesh Srivastava, chief investment officer at IDBI Federal Life Insurance, said.
The Sensex rose as much as 0.65 per cent to an all-time high of 22,592.10, while Nifty gained 0.63 per cent to a record high of 6,763.50.
The Sensex and the Nifty ended up 0.47 per cent each. IDFC Ltd surged 3.8 percent and LIC Housing Finance rose 4.7 percent as the India's election commission on Tuesday allowed the Reserve Bank of India to announce new bank licences even ahead of general elections.
The central bank had sought the commission's approval to ensure the process would not clash with the code of conduct, which prevents decisions that may be deemed as political from being taken by government officials or regulators.
Reliance Industries and Larsen & Toubro Ltd rose 1.7 percent each after earlier marking their 52-week high at Rs. 962 rupees and Rs. 1,310 respectively.Bharti Airtel gained 3.3 per cent after CLSA said the wireless services provider "is best placed to ride the data boom in India."
Motherson Sumi Systems ended up 3.8 per cent after earlier rising as much as 8.1 per cent to a record Rs. 275.85.Bank of America-Merrill Lynch has raised its target price on the auto parts maker to Rs. 311 from Rs. 248 while maintaining its "buy" rating.
Midcap pharmaceutical stocks surged as investors were attracted by valuations after under-performing recently versus larger rivals.Wockhardt surged 20 per cent to its daily limit, Ranbaxy Laboratories jumped 9 per cent, Strides Arcolab gained 10 per cent, while Aurobindo Pharma rose 4.6 per cent.
Hindalco Industries ended lower 1.6 per cent adding to Tuesday's fall of 2.5 per cent on profit taking after rising 8.3 per cent on Monday.