The Federal Reserve on Wednesday gave investors a reason to be bullish, but pressure from the White House is dragging down optimism, CNBC's Jim Cramer said.

The central bank decided to hold its benchmark interest rate in place at its June meeting and signaled the possibility for a rate cut in the future to boost a slowing economy. That means President Donald Trump, at least for now, did not get his wish.

"Normally I'd be telling you to buy stocks left and right with the Fed about to cut interest rates, and I still think it makes sense to be bullish," the "Mad Money" host said. "However, with the president on the warpath, you need to be more cautious, because even if the trade war is justified, the longer it goes on ... the worse it is for our economy."

History shows that financial, retail and housing stocks are good stocks to buy when the Fed decides to ease monetary policy, Cramer said. Earnings and forecasts can get a raise from rate cuts.

The Dow Jones Industrial Average gained 0.15% Wednesday, the grew 0.30% and the Nasdaq Composite expanded 0.42% during the session.

"Borrowing becomes cheaper, more money flows into the system via credit, and commerce picks up," Cramer said. "At the same time, short-term Treasurys become less attractive as investments compared to dividend yielding stocks."

Powell, though, has to maneuver the influence of Trump, who has demanded the agency cut rates and hinted at giving the chairman a demotion.

In his press conference, Powell said the consumer is strong but business investment has slowed, particularly in manufacturing, Cramer noted. Also, the chairman said he expects to serve out his full term.

"In theory, if these negative trends continue, then employment will soon take a hit and the weakness will start bleeding over to the consumer," Cramer said. "That's what the Fed is 'closely monitoring' — that's a phrase I told you you wanted to hear today — because it means Powell is getting ready to give us the rate cut."

Cramer said the Fed chair "kindly and respectfully" did not blame the slowdown on tariffs, but the trade war is on the agency's mind. The host added that Powell is "sitting on a powder keg" with Trump looming over him. Trump does not want to admit that a rate cut is needed because of the trade war and instead wants to blame it on the December rate hike, he said. Trump thinks tariffs are good for the economy, Cramer said.

"I think he wants Powell to give us a huge mea culpa. He'll tell us that the Fed is going to cause a recession, unless Powell relents," he said. "There is no escaping from the wrath of this White House. I bet the president will start playing the blame game right now before he heads off to the G-20 meeting."

What will trigger Powell to reverse monetary policy is weaker numbers in employment and consumer spending, Cramer said. More tariffs on China as threatened by Trump will not push the Fed to act, he said. Powell wants to keep the nature of the Federal Reserve independent.

"That's why I expect the president will keep hectoring him, and hectoring him, and hectoring, because Trump needs — desperately needs — to raise tariffs all over the place," Cramer said, "and needs desperately to have a lower rates" so the economy doesn't fail "before the election."