The Standard & Poor's 500 index rose 4.5% this week to a record close as investors grew more optimis