There's an old saying in the stock market: "Don't fight the Fed." It essentially means that when the Federal Reserve is raising interest rates, stock prices will struggle, and when the Fed is cutting rates, stocks will do well.

Long-term investors would be well-advised to avoid attempting to time the market. However, there are some stocks that will be, at worst, insensitive to higher interest rates and, at best, will even benefit from them. Let's look at three of these top stocks.

Picture of the Federal Reserve Building

Image source: Getty Images.

1. CME Group

CME Group (CME 1.99%) is the largest derivatives exchange in the U.S. It operates the Chicago Board of Trade and the Chicago Mercantile Exchange, as well as the New York Mercantile Exchange. These exchanges facilitate the trade of stock index futures, commodities, and interest rate contracts. CME Group is best known for interest rate products that allow investors to lock in borrowing costs or to minimize risk of interest rate movements. 

Early in the COVID-19 pandemic, the Federal Reserve cut the benchmark federal funds rate to a range of 0% to 0.25%. This had the unintended consequence of limiting investor involvement in interest rate products. Few people will want to bet that U.S. interest rates are going to go negative, so why hedge against such a minuscule risk? This reduced average daily volumes in the interest rate space.

With the Fed raising rates again, investors will once again be exposed to the risk of falling interest rates, and some will be interested in hedging that risk. CME Group is one of the few stocks that is positively impacted by rising rates. 

2. Realty Income

Realty Income (O 1.45%) is a real estate investment trust (REIT) that specializes in single-tenant properties under a triple-net lease arrangement. These leases generally have longer terms and feature automatic rent escalators. The company focuses on tenants that have defensive characteristics, such as convenience stores, drug stores, and dollar stores. Even if the economy weakens, people will still need to buy over-the-counter prescriptions, gasoline, and consumables. 

Realty Income is one of the few REITs that has not cut its dividend since the COVID-19 pandemic began. In fact, it increased its payouts three times during 2020 -- the worst period of the pandemic, economically speaking. If Realty Income can boost its dividend when tenants like movie theaters, child care centers, and gyms are closed, it can probably handle an interest rate increase. 

3. Mr. Cooper

While most mortgage originators have been hammered this year due to rising interest rates, one, in particular, has bucked the trend. That company is Mr. Cooper (COOP 1.53%), which has made a big bet on mortgage servicing rights. Mortgage servicers perform the administrative duties of handling a mortgage -- collecting payments, ensuring that investors get their principal and interest payments, making sure that property taxes are paid, and such. The servicer is paid 0.25% of the mortgage balance for performing these duties. So, for example, a servicer would get about $1,000 for servicing a $400,000 mortgage. 

Mortgage servicing rights are one of the few financial assets that increase in value as interest rates rise, because when rates increase, the chance of the loan getting paid off early falls. If a borrower took out their mortgage at 3.5% and current market rates are 6%, that borrower has no incentive to refinance. This means the value of the servicing rights increases because the servicer will probably get paid its fees for a longer period. 

Mr. Cooper is also a mortgage originator, and rising interest rates have caused that segment of its business to decline. That said, the increase in servicing income has helped offset that, which is why Mr. Cooper has outperformed its peers so far this year.