From tweets to tech to trade wars, investors have had multiple reasons to bail out of stocks this year. Instead, the S&P 500 is just another nudge away from setting a fresh all-time high. Rather than get shaken by scary headlines, the market has maintained a laser-like focus on fundamentals. A growing economy, record-setting corporate earnings and friendly atmosphere in the White House and the halls of Congress are feeding expectations that the second-longest bull market in history still has legs. "Right now I have a lot of things that scare the heck out of me. But you have to be careful not to see ghosts from the closet," said Doug Roberts, chief investment strategist at Channel Capital Research. "That's not to say things can't change quickly. You have to be cautious." Indeed, most market sentiment measures reflect that trepidation. Investors have been cautious about U.S. stocks in particular and continue to shovel money into bonds, despite rising yields that are denting returns for fixed income funds. Fewer than 1 in 3 retail investors think stocks will rise over the next six months, according to the latest American Association of Individual Investors survey. Yet four factors have combined to continue pushing the market higher. The S&P 500 is up about 6.9 percent year to date, just about 14 points away from its all-time closing high, as of Tuesday's close.

1. Corporate health and generosity

Coming off one of the biggest tax cuts in history, corporate America is having a stellar 2018. Second-quarter earnings are on track to increase 24 percent from the same period a year ago, a growth rate about in line with the first quarter. The beat rate vs. Wall Street expectations is at 80 percent, which would mark the best level since FactSet began keeping track in 2008. By way of comparison, U.S. corporate profits, including tax benefits, are on track to triple the earnings of foreign companies and double them excluding the tax break, according to Credit Suisse. In turn, companies are using those big profits to authorize a record level of share buybacks. Technology companies in particular have taken a huge share — about 40 percent — of the repurchases, important as some of the sector's biggest names like Facebook and Netflix have undergone substantial pullbacks recently. Goldman Sachs a few days ago estimated that share repurchases will eclipse $1 trillion for the year, exceeding already-lofty expectations. At a time when mom-and-pop investors are derisking, companies are stepping in to provide demand. That's just one reason markets are looking past the headlines and seeing plenty of reason to keep edging higher. "The market just sees through it. That's the job of the market, that's what we have to keep in mind," said Quincy Krosby, chief market strategist at Prudential Financial. "If you inundate the market with headlines, the market will focus on what's at hand. That's the earnings, that's the M&A activity, that's the notion that we've got this period in which share buybacks are picking up."

2. It's still the economy

Yes, you can nit-pick the data. Friday's jobs report actually missed Wall Street estimates as did the key ISM manufacturing number, and housing numbers have been pretty awful. But on the overall, the economy is still growing, with the second quarter's 4.1 percent GDP growth rate looking sustainable at least in the near term. And if there's one thing Wall Street knows, it's that bear markets seldom happen during expansions. "Ongoing economic growth has overwhelmingly favored positive equity returns in the past, with high odds of positive returns and low odds of large losses," Goldman Sachs Investment Management said in a recent update to its full-year forecast. "In fact, only one quarter of US bear markets have occurred during expansions. Moreover, equity returns have remained favorable until about five months prior to the onset of an economic contraction, highlighting the penalty for prematurely exiting the market in the absence of elevated recession risks." Ironically, Goldman holds one of the Street's most cautious views of the market, expecting the S&P 500 to end the year around 2,850, or close to where it is now. Yet the firm is advising clients to stay "fully invested" in U.S. stocks "due to steady earnings growth in an expanding economy coupled with a low and stable inflation environment that keeps interest rates in check." "While some may dismiss our continued recommendation to stay invested as a blind endorsement of a by-and-hold strategy, it actually reflects the low odds we have placed, and continue to place, on a recession in the US," the firm added.

3. Central banks step in

That reference in the Goldman report to interest rates is critical. In the U.S., the Federal Reserve is continuing to raise rates but insists its policy remains "accommodative," while its global counterparts are slowly — very slowly — unwinding the stimulus they combined to provide in the wake of the financial crisis. But that's not all. Central banks outside the U.S. also are combining with sovereign wealth funds to help prop up equity prices through holding exchange-traded funds that focus on the stock market, according to David Rosenberg, chief economist and strategist at Gluskin Sheff. By Rosenberg's estimates, the Bank of Japan is holding $250 billion worth, the Swiss National Bank has $180 billion and sovereign wealth funds also are devoting huge sums towards stock ownership. Oil-rich Norway, for one, has 60 percent of its $860 billion in sovereign wealth assets dedicated to equities. "They obviously have staying power and are not accountable to unit holders," he said of the entities. "It's not a conspiracy theory. It's just a reality," he added. "The plunge protection police is global and with very deep pockets."

4. Politics as a catalyst