Today was proof positive that good things can still happen in the stock market, Jim Cramer told his Mad Money viewers Thursday. That means investors need to stay the course, as earnings season gets under way on Friday.

Why was the market so bullish? Cramer said it started with strong earnings from Blackrock (BLK) , up 1.4%, Delta Air Lines  (DAL) , up 2.9% and strong same-store sales from Costco (COST) which sent that stock up 2.2%.

These earnings offset the horrible news from Bed Bath & Beyond (BBBY) , as that retailer continues its struggle against Amazon (AMZN) . Shares of Bed Bath plummeted 20% by the close.

In other news, the price of crude oil was lower for much of the day, which made investors ease off their inflation fears. Meanwhile, tech was back in favor thanks to strength in Micron Technology (MU) and Intel (INTC) , up 4.1% and 3.1% respectively.

And with softening talk on trade stemming from Washington, even Boeing (BA) and Caterpillar (CAT) were able to end the day higher.

Cramer and the AAP team are talking about Broadcom's (AVGO) huge $12 billion share-repurchase program. The timing is extraordinary. Find out what they're telling their investment club members and get in on the conversation with a free trial subscription to Action Alerts PLUS.

But Always Be Prepared 

There are uncertainties building in the market and investors need to be prepared, Cramer cautioned viewers. He then explained what might happen if President Trump were to fire special Special Counsel Robert Mueller, or if the U.S. takes action against Syria's chemical weapon attack.

When it comes to Mueller, investors need to take a page from history. Back in 1973, when President Nixon fired a special prosecutor, the markets took a 20% nosedive in the weeks that followed.

As for Syria, any military response would add a lot of uncertainty to the markets and would be especially bad for the airlines, cruise lines and others that are dependent on the price of oil.

At this point, Cramer said we simply can't tell which way Trump is leaning on either issue, which is why he recommends not doing any additional buying, but instead waiting for a better entry point if it comes.

There will always be people less informed than you, Cramer concluded, and when those people panic on the news, that's the time to buy.

Over on Real Money, Cramer takes a closer look at the impact of these two possible events. Get more of his insights with a free trial subscription to Real Money.

Caterpillar and United Rentals

Last week, the markets fretted over the prospects of a trade war with China. Earlier this week, those fears abated after positive comments from Chinese President Xi Jinping. But then, fears returned as investors simply don't know what's coming next.

So what does that mean for a stock like Caterpillar, which sells 5% of its machinery in China and looks toward China for much of its future growth? Cramer suggested that investors use the current strength in Cat to sell the stock and swap into a much safer machinery company, United Rentals (URI) .

Unlike Cat, United Rentals is 91% domestic, making it immune to any trade implications. The company is also more levered to commercial and industrial construction, whereas Cat is more levered to mining and commodities. United Rentals has better margins than Caterpillar, as renting equipment is far easier than making it.

Beyond that, the stock of United Rentals trades at just 12 times earnings with an 18% growth rate. Caterpillar trades at 16 times earnings and, in this environment, is the riskier stock. 

Executive Decision: Talend

For his "Executive Decision" segment, Cramer again sat down with Mike Tuchen, CEO of Talend (TLND) , the data analytics company with 36% revenue growth and a stock that's up 28% so far in 2018.

Tuchen explained that there are a lot of big companies chasing yesterday's market, but Talend is pulling data together, cleaning it up and making it ready for big data applications no matter where it lives. With more and more companies moving to the cloud, unifying your data is only becoming more important.

Tuchen said that Talend partners with companies like Red Hat (RHT) , which provide a platform for his company's applications to run on. Anywhere you find Red Hat, you'll also find Talend.

Another big driver for Talend are the new GDPR data privacy regulations in Europe. Tuchen explained that with the new laws, consumers own their data, which means companies need, more than ever, to be able to pull all of that data into one place and make it available to users upon request. 

Lightning Round

In the Lightning Round, Cramer was bullish on Salesforce.com (CRM) , American Airlines (AAL) , Align Technology (ALGN) , Procter & Gamble (PG) , United Bankshares (UBSI) , Valeant Pharmaceuticals (VRX) and Dominion Energy (D) .

Cramer was bearish on ABB Ltd (ABB) , Realty Income (O) and iRobot (IRBT) .

Off the Tape: Cyxtera Technologies

In his "Off The Tape" segment, Cramer sat down with Manny Medina, chairman and CEO of the privately-held cybersecurity company, Cyxtera Technologies.

Medina explained that many companies and governments are having trouble securing their infrastructure because most cybersecurity products rely on creating a secure perimeter around critical infrastructure.

But in today's world, where companies have infrastructure in their own data centers, in colocation facilities and in the cloud, with users accessing that infrastructure from all over the world, perimeters simply don't work anymore.

Cyxtera is developing new technology that provides both physical and software barriers that can secure a network no matter where it's held.

Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

At the time of publication, Cramer's Action Alerts PLUS had a position in AVGO, AMZN.

More from Jim Cramer

As Good As it Gets?: Cramer's 'Mad Money' Recap (Monday 10/15/18)

As Good As it Gets?: Cramer's 'Mad Money' Recap (Monday 10/15/18)

Microsoft, Medtronic, Raytheon: 'Mad Money' Lightning Round

Microsoft, Medtronic, Raytheon: 'Mad Money' Lightning Round

Jim Cramer: Have Negative Things to Say on Your Call? Your Stock Will Go Lower

Jim Cramer: Have Negative Things to Say on Your Call? Your Stock Will Go Lower

Jim Cramer: Is This as Good as It Gets?

Jim Cramer: Is This as Good as It Gets?

Canopy Growth CEO: This Is What Legalization of Cannabis Looks Like in Canada

Canopy Growth CEO: This Is What Legalization of Cannabis Looks Like in Canada