The Australian sharemarket closed just off a record high on Thursday, as renewed optimism in the US-China relationship, spurred a rally in key stocks.