The benchmark S&P 500 is set to post its fifth straight weekly gain and is hovering near a fresh record high after rising over 21% this year.