Energy companies were trading higher and mining and metals companies also posted gains. But retail stocks struggled after some weak sales reports.