Traders celebrate on the main trading floor of the New York Stock Exchange as the Dow Jones industrial average passes the 20,000 mark shortly after the opening of the trading session in New York, January 25, 2017.

The S&P 500 could soon reach a new all-time high and then may very quickly, hit a wall.

Strategists expect the S&P 500 to easily push into record territory and beyond in the dog days of August, but they say watch out for turbulence and a likely pullback once markets get past Labor Day.

The is edging toward the record high of 2,872, set on Jan. 26, and it's very likely to make it before the end of the month, or even week. The S&P closed at 2,858, up 8 and is just a half percent away from the high. The Dow continues to trade about 3.7 percent below its high, while the Nasdaq previously recovered its high but is now below it.

"The only things that stand between our year-end price target of 3,000 and new highs are two things — the potential for the trade war not to be resolved in some sort of satisfactory way before the November midterm election, and the seasonality," said Julian Emanuel, chief equity and derivatives strategist at BTIG. "The markets tend to have near-term peaks in August, and September has historically been a negative return month, and it's also the most volatile month of the year, and to think there won't be a pullback in the month of September, is normally an incorrect thought to have."

Strategists say a sell-off could prove a positive, drawing in buyers and providing grist to push the market back to its highs after the midterm election and into year-end.

"There could be a short-term psychological problem with the market once it hits the all-time high," said Don Townswick, director of equities strategies at Conning. "You can never tell, but I think once you get there to the all-time highs, then at some point there can be a little bit of a drop off, a short-term pull back. ... But I still think there is significant expansion potential particularly with inflation under control, and with interest rates at these levels, it's like stepping on the gas pedal."

A positive booster for stocks should be the record $1 trillion in share buybacks this year, with 13 percent of buying expected in August alone.

Analysts agree that the trade and tariff battles coming from the White House are the biggest obstacle for stocks, since they threaten economic growth and earnings should they continue to escalate. They could also push inflation higher from its relatively calm levels.

"This came up on a lot of conference calls," said Lori Calvasina, head of U.S. equity strategy at RBC. Trade concerns are "exasperating the inflationary problem and people are beginning to get worried about margins. That's not going to change just because the index hits a new high. Thirty-five percent of the companies in the S&P that reported had their operating margin expectations trimmed by the sell side for 2018 as a whole."

But Calvasina, who has a year-end target of 2,890, has a less upbeat view of the market into year-end, and said a peak in earnings growth of 24.8 percent in the second quarter should be followed by slower earnings growth for the rest of the year though it is still near 20 percent or more.

That could make the market slow down. "When you have a big peak in earnings growth but you decelerate, markets are usually weak in the six months after the peak in earnings growth," she said. "It looks like a decelerating story is in tact for 2019. The consensus numbers are only calling for 10 percent, and you can debate the quarterly numbers but 2019 is only going to be about half of 2018 [earnings growth.]"

Trade wars would only make the slowdown in growth worse.

"I think the cost pressures are real. Even if these tariffs fade into the background, these companies are talking shipping, transportation. Labor, wages and payroll came up a lot and that issue is not going away. The issue with inflation is it's what's giving the Fed confidence to hike," she said.

Emanuel said he expects trade issues to be quiet for awhile in August, giving the market time to work higher temporarily, in a low-volatility mode. The VIX, or volatility index, on Tuesday was near the lows reached at the start of the year, right around 11, suggesting market participants are positioned for very low volatility.

But that could change as the midterm elections approach.

Calvasina said that's a big concern of investors, and for the most part, they favor a GOP Congress. "I worry about it from the perspective that I think it's going to be close. Both sides are pretty energized. Our survey of investors shows that hopes for Republicans taking both chambers has grown. The last read I had shows the market was getting more bullish on Republicans. I think it's going to be closer than most investors assume. Usually stocks are weaker in the summer months before the election, and we've seen that this year," she said.

"It's very geopolitically oriented. Earnings season has done everything it can do in terms of the heavy lifting. If there's volatility over the next 45 days or so, as there typically is, we consider that to be a buying opportunity," he said. Emanuel said the surprise would be if there isn't a pullback.

Townswick said he expects the midterms to crop up as an issue. He expects the S&P 500 to hit its high soon and then run into trouble in September. "Midterm years tend to be volatile anyway, and I think [a pullback] would fit in there very nicely," he said. "I think back-to-school time, probably September or October. I think August might continue to go up the wall of worry. The bricks in the wall of worry are about trade."

The market is not yet fearful about the Fed, expected to raise interest rates two more times this year, he said.

"I think that we're in the middle of the longest expansion in history ... I think the fundamentals do support these levels and even support beyond this. History shows even when you get to the levels of valuation that we see now that there tends to be an overshoot," said Townswick. "By a lot of traditional measures, we're fairly valued and the market tends to get overvalued before it drops. ... With the level of growth that we saw coming in, I would expect medium- to longer-term expansion.