Bank stocks performed tremendously well in 2016, but there could still be more upside in the years ahead. If you're thinking of adding a bank stock or two to your portfolio as we head into 2017, here are three you may want to consider.

Bank Sign On Building

Image Source: Getty Images.

Bank stocks had a great 2016

The financial sector was one of 2016's best performers, up 20% for the year, which was about double the gain of the S&P 500.

XLF Chart

XLF data by YCharts

If you take a closer look at the chart, you'll notice that financial sector underperformed the S&P for most of the year. Most of the gains took place over the last two months -- specifically, after the election.

In a nutshell, the market thinks the election of Donald Trump as the next president of the United States, as well as a Republican majority in the House and Senate, could be the magic formula to catapult bank profits higher. Rising interest rates would translate into higher profit margins, deregulation could lower ongoing costs and make it easier for banks to do business, and Trump's job and wage growth plans could produce more demand for banking services.

... but the rally could be just getting started

Although the "Trump rally" in bank stocks has been substantial, we may not be done just yet. Without getting too technical, the bank stocks are currently pricing in the possibility of all the things I mentioned, as well as the possibility that they won't happen. For example, it's entirely possible that economic growth will be much less than expected and the Federal Reserve won't raise interest rates.

The point is that if the positive catalysts the market expects actually happen, there could be another leg up. And, bank profits could stay elevated for years to come.

Three smart ways to play it

Having said all of that, I have a positive outlook for bank stocks in general over the next few years at least. There are many great bank stocks to buy, but here are three of my favorites right now.

1. Bank of America (NYSE:BAC) was one of the best performers of 2016, up by more than 30% for the year. And there's good reason the bank was a big beneficiary of the Trump rally -- it stands to benefit from higher interest rates more than peers. Simply put, the bank has more noninterest-bearing deposits than the rest of the "big four" U.S. banks, which should allow the bank to capitalize on its interest-bearing assets, such as loans, more than peers. In fact, the bank has said that its net interest income would increase by $5.3 billion annually with a 100-basis-point increase in rates. Along with its most recent earnings report, Bank of America announced that even though its share price is higher, it is boosting its buyback plans by more than 70%, which tells me that management still considers the stock to be a bargain.

2. Financial Select Sector SPDR Fund (NYSEMKT:XLF) is a great choice if you believe the banking sector will perform well, but don't want to choose individual stocks. The fund has a low 0.14% expense ratio, and is designed to track the performance of the financial sector as a whole. The fund's top holdings are:

Company

% of Fund's Assets

Berkshire Hathaway (B shares)

10.8%

JPMorgan Chase

10.8%

Wells Fargo

8.7%

Bank of America

7.8%

Citigroup

5.9%

Goldman Sachs

3.1%

Data Source: TD Ameritrade. Information is current as of 12/31/16.

3. BofI Holding (NASDAQ:BOFI) is a more speculative choice, but one that deserves serious consideration. The bank, whose name stands for "Bank of Internet", is the oldest internet-only bank in the U.S. By maintaining an online-based business model, the bank enjoys competitive advantage such as low overhead and the ability to offer better rates on loan and deposit products than peers.

The bank's growth has been impressive, especially in recent years. Since 2012, the company has grown its earnings per share at a 34% annualized rate, and has increased its return on equity (ROE) to a staggering 19.4% (the industry standard is 10%). Furthermore, over the past few years, the bank has successfully transitioned away from a time deposit (CD) business model to an asset portfolio dominated by checking and savings accounts. Impressively, the bank has produced its growth while maintaining significantly better asset quality than peers -- BofI's net charge-off rate is less than one-tenth of the average for a bank of its size.

These are not low-risk stocks, so invest accordingly

No stock that is capable of the gains these banks generated in 2016 is without risk. There is a lot that could potentially go wrong -- for example, the economy could enter a recession and interest rate growth could grind to a halt. While I believe with a Republican-controlled Congress, President-elect Trump will succeed in lowering taxes and rolling back regulations, it's far from certain at this point.

Matthew Frankel owns shares of Bank of America, Berkshire Hathaway (B shares), and Goldman Sachs. The Motley Fool owns shares of and recommends Berkshire Hathaway (B shares) and BofI Holding. The Motley Fool has a disclosure policy.