CNBC's Jim Cramer on Tuesday said Federal Reserve policy was to blame for the December sell-off and that the agency's adjustments have since produced a bull market.

That has created good odds for names like Caterpillar, Home Depot, and the other stocks that investors dumped the day before Christmas, said the "Mad Money" host, who thinks the market has more legs to run.

"I'm grateful and therefore bullish, because it's almost never too late for the Fed to switch directions," Cramer said.

On Tuesday, Fed Chairman Jerome Powell said in a Senate hearing that the U.S. economy is still strong but warned of headwinds in foreign markets. The central bank will "carefully monitor" those challenges and make necessary adjustments, he said, months after spooking investors by declaring that the balance sheet roll-off was on "autopilot."

"The fact that Powell knows things are slowing down, well, that may be the best thing this market has going for it," Cramer said. "It's one reason why we rallied from a very ugly opening and were briefly in the black before a hiccup at the close."

The three major U.S. indexes saw a dip in Tuesday's session.

Coming off a weaker-than-expected earnings report before the bell Tuesday, Home Depot shares closed nearly 1 percent lower. Earnings and revenue misses heightened investors' concerns about weak housing data and that the market's "falling off a cliff," Cramer said.

"In reality though, housing froze in the fourth quarter because of rate hike fears and now it's unthawing because the Fed has changed its tune, which makes me bullish on Home Depot, not bearish," he said. "But the turning in this stock from hideous to merely ugly by the end of the day speaks loads about how at least some people are catching onto the right way of looking at things."

Additionally, Caterpillar's stock price lost about 2.4 percent on Tuesday due to a double downgrade from UBS, Cramer said. An analyst at the Swiss bank dropped the equity's rating from buy to sell and 12-month price target to $125 from $154 on worries that slowing demand in the construction, energy, and transportation sectors will weigh on revenue and margins in 2020.

Cramer has a different outlook for the machine manufacturer. He thinks a dovish Fed could help the market resurge this spring and that a potential trade deal between the United States and China, the largest economies on earth, could help world economics.

"Does anyone honestly believe the global economy won't make a comeback if we can make a trade deal with the Chinese? I think Caterpillar is exactly, precisely the kind of stock that would scream higher on any kind of agreement with the PRC," Cramer said.

The host thinks this is a time to buy on Wall Street and investors should ditch the idea that a downturn like last decade's financial crisis is looming.

"We're no longer fighting the Fed, people. So don't be misled by data from the fourth quarter when Jerome Powell was still stock market enemy number one," Cramer said. "That's why I think you should buy, not sell, the likes of Caterpillar and Home Depot. ... When the Fed is your friend, these are exactly the kind of stocks that like to go higher."