The Sensex gained 9.2 percent in October, its biggest monthly gain since January 2012 on strong foreign inflows as a delay in the U.S. Federal Reserve's tapering of monetary stimulus led to a surge of money in risk assets.
Overseas investors were net buyers for a 19th consecutive session on Wednesday, bringing their total buying to nearly 160 billion rupees during that period.
The Sensex rose to an intraday high of 21,205.44, just short of the all-time high of 21,206.77 seen in January 2008.
The index has now gained 21.3 percent since it hit an intraday yearly low of 17,448.71 on August 28.
"We are seeing strong support from institutional investors. Markets can go up to another 100 points (in Nifty). Going forward, there could be profit-taking after Diwali," said Suresh Parmar, head of institutional equities at KJMC Capital Markets.
"Stock and sector specific rally could continue, especially in IT stocks," he added.
The Sensex rose 0.62 percent, or 130.55 points, to close at 21,164.52.
The broader NSE Nifty rose 0.76 percent, or 47.45 points, to end at 6,299.15.
The rally was led by state lenders including State Bank of India which closed 4.4 percent higher, while Bank of India
Among other stocks, Tata Steel