ASX closes week up 3.5% after record highs, energy leads