Markets are about to break out to historic highs. The , the S&P mid-cap, and the S&P small-cap indexes are all less than 1 percent away from the historic highs they hit in January.

The S&P 500 has moved nearly 2 percent in the last three trading sessions and is now 22 points (less than 1 percent) from passing its January peak.

The broad market has been moving on a potent combination of factors:

1. There is a generally strong earnings narrative for the second half of the year. Second-quarter earnings are 80 percent over, but what's keeping markets going is that third- and fourth-quarter guidance is not dropping significantly. The third quarter is expected to see S&P earnings up 22.7 percent, just slightly lower than when the second quarter ended. And fourth-quarter earnings are expected to gain 20.6 percent, according to Thomson Reuters.

2. There has been limited impact from tariffs. While a small group of companies (including General Motors, Whirlpool and Newell Brands) have reported some effects, the vast majority continue to see little impact.

3. There has been a tidal wave of announced buybacks. Revenue growth is up about 10 percent in the second quarter, indicating that corporations are flush with cash. There's been a record $754 billion of share purchases announced so far, according to Goldman Sachs, with $1 trillion the expected total by the end of the year, up 46 percent over last year. Not all of these buybacks will result in outright share count reductions (that's what matters), but enough of them will to make a difference (particularly Apple, which has already bought back north of $40 billion in stock).

4. There's a market rotation underway. The market has not been entirely dominated by technology. When tech has been weaker, traders have not been selling and leaving the market; they have been buying other sectors. In the last month, we have seen a move to defensive, value-oriented stocks (health care, banks and especially consumer staples).

5. There has been continued strong GDP growth, looking to be will be well over 3 percent for the rest of 2018.

What will it take to get the S&P over the finish line? For all the above reasons, the U.S. has again emerged as a favorite of international investors, especially since fears of a trade war and dollar strength have greatly affected the Asian markets.

Bears are not having much luck pulling out the old "peak earnings" argument. Traders seem perfectly capable of understanding that profits got an extra boosts from tax cuts, and profits next year are expected to increase at a healthy 10 percent clip over 2018. Bulls like ISI's Ed Hyman noted over the weekend that the S&P has continued to increase after earnings growth has peaked on many occasions.

After reviewing the economic and earnings data, Hyman concluded that "This argues for a very long expansion."

Correction: This story has been revised to correct that Apple has bought back more than $40 billion in stock.