The S&P 500 is bound for 2,700 by the end of the year, according to Brad McMillan, chief investment officer at Commonwealth Financial Network.

That would imply a 7.7% upside from its current level of 2,507. 

But that target is only in play if we continue to see strong earnings growth in the coming quarter, McMillan said, something that's not guaranteed. S&P 500 companies clocked double-digit year-over-year earnings increases for the past two quarters.

McMillan also said it's possible for small cap stocks to stage a bigger rally than the S&P 500 for the remainder of the year. 

The S&P 500 is up roughly 12% since the beginning of 2017.

More From TheStreet: