Both the broad market S&P 500 index and NASDAQ Composite Index also showed gains .