The S & P 500 and the Nasdaq indexes recorded their third straight week of gains .