The stock market clocked gains in October after two straight months in the red, as foreign investors returned in the just-ended week. Healthcare stocks led gains during the week, even as high oil prices continue to cloud corporate earnings. After the sell-off in the precious week, the Sensex rose 1.8% and the Nifty 50 2% over the week. The recovery helped the Sensex finish October 2.7% higher, ending a two-month losing streak after declines of 5.8% in September and 1.5% in August.