Warren Buffett and his conglomerate Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) spent more money buying stocks in 2022 than they did in any other year of the 21st century (and maybe ever), according to filings from the Securities and Exchange Commission.

While we won't know the final tally for the year until the fourth-quarter numbers are published, through the first three quarters, Berkshire Hathaway spent over $66 billion on equities.

That massive number hints at Berkshire Hathaway's long-term bullishness. But that stock buying came with an interesting twist.

The timing of the purchases

Interestingly, Berkshire Hathaway did the large majority of its buying early in the year, purchasing more than $51 billion of stocks in the first quarter.

Obviously, the world was quite different then. The Federal Reserve was just beginning to hike interest rates, and investors were more bullish at the time, despite their growing concerns about inflation. Additionally, several of Berkshire Hathaway's purchases were likely made before Russia invaded Ukraine in late February, which also put the global economy and the markets on markedly different trajectories than they had been, and clearly caught a lot of investors off guard. 

This brings me to the big twist: Berkshire Hathaway did most of its stock buying when the market was near its high points for the year. Timing the market is extraordinarily difficult, even for some of the best like Buffett and his investing team. Buffett is normally seen as a long-term investor. But he and the Berkshire Hathaway portfolio managers clearly had very different views of the market earlier in 2022 than they do now.

^SPX Chart

^SPX data by YCharts.

Since the first quarter, Berkshire Hathaway has continued to buy shares, but not nearly as aggressively. It has also done some selling and repositioning of its portfolio, and a lot of the purchases made in the second and third quarters were additions to existing positions.

Berkshire Hathaway has been heavily buying shares of U.S. oil producers such as Occidental Petroleum (OXY -0.15%) and Chevron (CVX 0.37%). Berkshire Hathaway owns at least 21% of Occidental Petroleum's outstanding shares, making the energy company the third-largest position in its portfolio.

What does this tell us?

It's very interesting to see how Berkshire Hathaway bought so aggressively in the first quarter and then slowed its buying as the market slid lower. This could suggest that Buffett's view of the economy changed pretty dramatically in 2022.

It was also interesting to see Berkshire Hathaway buying oil stocks so aggressively. That likely means the conglomerate expects the price of oil to rise. If that happens in 2023, inflation may be even more persistent, which in turn could lead the Fed to either raise interest rates higher than expected or keep them higher for longer. This would likely slow the economy down further, which could spill over into the markets.

Ultimately, I think Berkshire Hathaway's rapid shift in investing activity during one of its most active years of stock-buying ever suggests that the company may have concerns about the economy in the near term, but also suggests it's still quite bullish long term. Attempting to time the market is rarely a great strategy, so instead, Berkshire Hathaway is buying stocks at what it believes are good valuations and planning to hold them for many years, which is a good strategy for every investor to follow.