The S&P 500 posted a 1.5% decline on Thursday amid worries about the Trump Administration and a terror attack in Barcelona.

The broad index has only had a decline of more than 1% a few times this year. Jeff Greenberg, capital markets economist at JPMorgan Chase, said the selloff provided a buying opportunity, especially as the near-term corporate earnings picture remains strong. 

He said stocks in the technology, health care and financials sector will help boost the markets for the remainder of the year. 

More From TheStreet: