Like many investors, I haven't been optimistic about the near-term prospects for the stock market in quite a while. It's hard to be cheerful when the Nasdaq Composite Index has been in a bear market for months and the S&P 500 briefly entered bear market territory.

To be clear, my positive view of stocks as a long-term investment hasn't changed at all. However, I've been generally gloomy about the market over the shorter term. Until now. Here are three reasons why I'm getting more bullish about stocks.

1. The possibility we're in a recession

You might be surprised by my first reason for increased optimism. My newfound bullishness is based in part on the likelihood that the U.S. economy is now in a recession.

Granted, a recession isn't official until the National Bureau of Economic Research says so. However, two consecutive quarterly declines in GDP usually mean that a recession is underway. 

So why does this make me more enthusiastic about stocks over the near term? A recession could mean good news for investors is on the way. The stock market often begins to rebound well before a recession ends. And in the 12 months following a recession, the market generated positive returns 91% of the time, since 1953, based on an analysis conducted by Darrow Wealth Management.

2. Surprisingly positive quarterly updates from leaders

Another reason behind my change in outlook comes from recent news from several giant companies. Just three stocks make up nearly 17% of the S&P 500: Apple (AAPL 1.27%), Microsoft (MSFT 0.37%), and Amazon (AMZN -1.64%). And all three delivered positive quarterly updates.

Apple beat the consensus earnings estimate in its latest results. More importantly, though, the company's management was also bullish about the future. Apple looks for accelerating growth in the next quarter. CEO Tim Cook also said that the company isn't seeing "obvious evidence of macroeconomic impact" on iPhone demand. 

Microsoft missed Wall Street expectations on both the top and bottom lines. The stock nonetheless jumped after its quarterly update in July because Microsoft projected double-digit growth for revenue and operating income in the coming fiscal year. 

Meanwhile, Amazon delivered stellar Q2 results. The company's digital ad business continues to grow. Its Amazon Web Services cloud unit remains a huge winner. There were also signs that the overcapacity issues affecting the e-commerce segment are improving.

For the most part, as the leaders go, so goes the broader market. When Apple, Microsoft, and Amazon please investors, there's usually a good reason to be optimistic about the overall stock market.

3. Positive signs that inflation could be waning

Last, but certainly not least, there are some positive signs that inflation could be waning. No, the inflation rate hasn't come down yet. But I won't be surprised if it does in the near future.

The most visible hint that inflation could have already peaked is the decrease in gas prices. After hitting sky-high levels earlier this year, gas prices have tumbled over the past seven weeks. Much of the rise in prices of other products was due to higher transportation costs. 

The housing market also appears to be cooling off. Sales of both new and existing homes have declined. Applications for mortgages have dropped to the lowest level in more than two decades. 

If these trends for gas and housing continue, the inflation rate will almost certainly fall as well. If that happens, the Federal Reserve wouldn't need to continue raising interest rates. In this scenario, investors would have a lot more confidence about the economy and the near-term prospects for companies.

Cautious optimism

I'm in no way proclaiming that another bull market is imminent. Stocks could quite possibly go down more before they begin a sustained rebound. Big companies could report much worse results in the next quarter. Inflation could remain a serious problem, especially if gas prices go up again.

However, I'm cautiously optimistic about the near-term prospects for stocks for the first time in months. Even better, I'm unabashedly optimistic about the long-term prospects for top-tier stocks.