Markets ended with marginal gains ahead of the U.S. presidential election, with the Sensex closing at 18817.38, up 54.51 points. Cipla was the top gainer, recording a 62% year-on-year profit increase, while Hindalco and Reliance Infrastructure faced declines in profit. The market breadth remained positive with 1516 advancing and 1304 declining stocks.