After a month when markets were whipsawed by the presidential election and worries about the “fiscal cliff,” shares ended not far from where they started.