The broader markets are near all-time highs again after a strong rally so far in 2019. That said, there's a lot of uncertainty in the world today, including high corporate debt levels, a plethora of global hot spots, and the trade tensions brewing between the United States and a number of key trading partners, notably China.

Complications with that last issue, which involved a tense tweet from President Donald Trump, led to a 2.5% decline in the S&P 500 Index on Monday, May 13. That's a pretty big drop for just one day, but not every stock fell. Royal Gold (RGLD 1.35%), W.P. Carey (WPC 0.75%), and NextEra Energy (NEE 2.41%) were all up on the day. Here's why that happened, why it should be important to you, and which stocks you might want to consider adding to your portfolio today if stock market volatility has you worried.

We all want to sell at the top

Investing is a tough business, filled with very smart people, and many investors believe that they're above average. Without confidence like that, people simply wouldn't invest -- they'd shove money in a mattress.

Confidence isn't a bad thing, but it's something that you should temper or your overconfidence could lead you to take an overly aggressive stance in the market. And that, in turn, could lead you to panic when the market winds turn against you.

A young woman in a business suit drawing a risk versus reward chart.

Image source: Getty Images.

Although that general explanation doesn't capture the full dynamics of the 2.5% S&P 500 Index decline on May 13, it provides a good overview. Simply put, everyone wants to buy low and sell high. But few people can actually time those moves right. And even fewer can do it consistently.

What generally ends up happening is people panic at the thought of losing money and then, en masse, try to run through the exit door. The bottleneck at the door is what leads to a steep drop in the market.

However, smart investors realize that not all investments are alike. There are some that actually do well when people are panicking because they're viewed as safe-haven assets -- places to hide during a storm.

Stocks in these sectors often go up when the broader indexes are falling because investors are buying them instead of simply going to cash. That's why real estate investment trust (REIT) W.P. Carey's stock was up 0.4%, a nearly 3 percentage point outperformance versus the S&P. Gold streamer Royal Gold and utility NextEra did even better, up 1.5% and 1.65%, respectively, a 4 percentage point outperformance.

To be fair, these are just examples from three sectors that tend to attract investor attention when the markets are volatile. However, here's a little bit more about each of them and the sectors they represent so you can consider adding a little diversity to your portfolio in preparation for the next downdraft.

1. Real estate

REIT W.P. Carey owns a globally diversified portfolio of single-tenant properties backed by long-term leases. The land and buildings themselves have inherent value, even if a tenant were to vacate the building. That said, an average lease term of roughly 10 years means that Carey's rents will tend to be pretty steady, even during market downturns.

Luckily, bear markets and recessions tend to be shorter than the average lease term on Carey's properties. And W.P. Carey is careful to select properties that it believes are vital to its lessees' businesses.

SPY Chart

SPY data by YCharts.

Many of these aspects are true for REITs, in general, though not for all property types (hotels, for example, have a lease term of roughly one night). But with the intrinsic value of property as a backstop and the lease obligations providing continuity of revenues, it's easy to see why investors would find real estate investments appealing in a downturn. Add to the allure the generally high yields offered by REITs and the story gets even better. Carey, for its part, offers a solid 5% or so yield backed by over two decades of regular annual increases.

If that sounds good to you, then Carey is a solid name to look at because it provides exposure to the industrial (23% of rent), warehouse (21%), office (26%), and retail (18%) sectors. That's a level of diversification that most REITs don't provide. It also generates around a third of its rents from foreign markets, largely Europe, another level of diversification that's unique.

In a storm, spreading your bets among multiple property types is a good play. That said, don't for a second think that Carey is the only REIT worth looking at -- investors who are worried about market volatility should explore the entire REIT space for safe-harbor options.

2. Slow and steady wins the race

NextEra Energy is another name that investors worried about market gyrations flocked to -- and for good reason. It is, at its core, a provider of something that we simply can't live without: power. Moreover, it has a government-granted monopoly in the regions it serves. Although that means the company, which operates the largest utility in the growing state of Florida, has to get its rates approved by regulators, it also means that its top line tends to be fairly steady, even in tough times. Simply put, you don't stop using electricity because the stock market drops.

That stable, government-protected business is the basis of the utility sector's defensive nature. If the market has you worried, you might want to look at adding a utility stock or two to your portfolio to increase your diversification. That said, not all utilities are made of the same stuff. As with REITs, you need to be a little selective.

NextEra, for example, is a rather expensive utility stock. However, there's a good reason for this: It's really two companies in one -- a boring utility and one of the world's largest renewable-power companies. The utility is the core business on which the company is building out its higher-growth renewable portfolio, where sales are generally backed by long-term contracts.

Overall, NextEra has done an incredible job of rewarding investors, with 25 years of annual dividend increases and a robust dividend growth rate of around 10% annually over the past decade. That helps explain why investors have flocked to the stock, pushing the yield, at around 2.5%, to the lower end of the utility spectrum.

NEE Dividend Yield (TTM) Chart

NEE Dividend Yield (TTM) data by YCharts.

Once again, NextEra is just one example of a utility you might consider. But it happens to be a very good one.

Still, don't limit your research to NextEra. If you like the idea of owning a provider of necessity products during a downturn, take some time to examine the entire utility market.

3. The ultimate "hard asset"

The last name here is Royal Gold, which, as its name implies, is involved in the production of gold and other precious metals. For some people, the yellow metal is the top dog of safe havens. Investors have historically jumped into the gold space when markets turn south, looking to protect their assets from falling prices. That said, there are many different ways to get exposure to gold.

The basic options are buying gold coins, a gold miner, or a streaming company like Royal Gold. Gold coins, or exchange-traded funds that directly invest in physical gold, are fine options, but they have one big limitation -- an ounce of gold will always be an ounce of gold, so there's no growth opportunity. That's why investors often shift their attention to miners, as they can expand their gold production over time.

However, streaming companies are probably a better bet for most investors. Streamers like Royal Gold provide cash upfront to miners in exchange for the right to buy gold and silver at reduced rates in the future. The miners often use the money for expansion projects, while Royal Gold ensures itself contractually wide margins on the gold and other commodities it buys -- and avoids all of the complications of running a mining operation.

RGLD Chart

RGLD data by YCharts.

Like the REIT and utilities noted above, Royal Gold is just one example of a streaming company. There are others you can look at, and you might even want to consider other gold options (like miners and ETFs).

However, Royal Gold has a pretty impressive history of success behind it in what is an often volatile sector. The biggest example of this is the company's 18 years worth of annual dividend hikes. In recent years, the increases have averaged around 4% -- not huge but more than enough to keep up with inflation.

Although the yield is a modest 1.2%, investors looking to add a little diversification to their portfolios should do a deep dive here. And if Royal Gold isn't to your liking, consider other precious-metals options if you're looking to add some safe-haven assets to your portfolio.

No cure all, but still worthwhile

Although these real estate, utility, and gold stocks all performed very well when the market was falling on May 13, there's a bigger picture here. Yes, these sectors are generally considered to provide safe havens in a storm, but the real issue is adding diversification to your portfolio. W.P. Carey, NextEra, and Royal Gold all provide that opportunity, largely because they often perform differently than the broader market.

The downside of this fact is that these stocks and the sectors they represent can lag the broader market during good times. But when bad times hit, you'll be happy to see some green in your portfolio when everything else is flashing red.