When looking at stocks to hold for the long haul, it is important to consider a company's long-term history and ask if it has any competitive advantages that give it staying power. A durable competitive advantage is one that isn't easily duplicated.

Often these companies operate in industries where there are huge barriers to entry. These type of stocks are the stalwarts of a portfolio, where they throw off income and consistently earn a decent profit. Here are two companies that fit the bill.

A trader on exchange floor talks on a phone.

Image source: Getty Images.

1. Intercontinental Exchange: The parent of the NYSE has very little competition

Intercontinental Exchange (ICE 0.18%) is the parent company of the New York Stock Exchange, although the company's business includes a total of 12 different regulated exchanges worldwide. The company trades stocks, commodities, bonds, and derivatives. The exchange's business accounts for the majority of Intercontinental Exchange's revenue. 

Intercontinental Exchange also sells its data and provides technology services to various customers. It also provides analytics for many of its products. Finally, the company has been building its offerings in the mortgage space. It recently acquired Ellie Mae, which provides workflow solutions for mortgage lenders. Intercontinental Exchange intends to help streamline the mortgage origination process, which is still largely done manually.

Established stock exchanges have a competitive advantage in that investors will choose to trade where the most liquidity lies. Even if an upstart exchange charges lower transaction fees, if bid-ask spreads are wider, the investor will be better off trading where the liquidity is best. Intercontinental Exchange competes with Nasdaq for stock listings, and the overall business is a duopoly. 

2. Realty Income is a Dividend Aristocrat that has navigated many tough cycles

Realty Income (O 0.52%) is a Dividend Aristocrat that has been around since 1969. The company owns single-tenant real estate and leases those buildings through long-term leases where the tenant is responsible for the majority of the expenses, including taxes, insurance, and maintenance. These leases are called triple net leases, and they are usually given only to the most blue-chip clients. They are generally long term and have automatic escalators. 

The COVID-19 pandemic was a difficult period for most real estate investment trusts (REITs), and many were forced to cut their dividends to conserve cash. Realty Income actually increased its dividend three times in 2020. It was able to do this because its biggest tenants were deemed essential businesses. The REIT caters to dollar stores, drugstores, and convenience stores. These businesses sell consumer nondiscretionary goods, which means their foot traffic is largely insensitive to the economy. Even if times are rough, people still buy toiletries, medications, and snacks. 

Realty Income doesn't necessarily have a huge competitive moat like Intercontinental Exchange; however, it has a long history in the triple net lease space and has very cheap borrowing costs. This gives it an advantage over, say, a private equity fund that might want to do the same thing. At current levels, Realty Income pays a dividend yield of 4.3% and has a long history of dividend increases. It should be considered a core holding for income investors