U.S. stocks posted solid gains for the week as the technology sector (the largest segment of the S&P 500 Index) rallied, helped by strength in Apple due to the expected announcement of a new video streaming service.