Gains in many sectors, including the oilsands, were offset by losses in sectors like retail.