Nasdaq gains 18%, S&P rises 14% in 1st half of 2024