After hitting their lows in October last year, stocks have gone on a tear. The S&P 500 index is up more than 31% from its lows, while the tech-heavy Nasdaq Composite index has gained 48%. The recent rally in stocks has investors optimistic that a new bull market is just over the horizon.

Interactive Brokers (IBKR -1.01%) is one stock that has enjoyed considerable gains. The electronic trading platform thrived when competitors struggled to hold onto deposits, and the stock is up more than 50% from its 52-week low. Despite the recent run-up, Interactive Brokers remains an excellent stock you can buy today. Here's why.

Interactive Brokers' secret to success

Interactive Brokers provides investors with an electronic trading platform to buy and sell stocks, options, bonds, futures, and exchange-traded funds. This platform stands out because of its appeal to tech-savvy investors, and its automated trading platform offers some of the industry's lowest-cost trades.

The company's commitment to saving customers money is evidenced by its senior managers, most of whom are software engineers committed to automating as much of the business as possible. Its low-cost platform has attracted customers in droves. Since 2017, Interactive Brokers' cleared customer accounts have grown from 483,000 to 2.29 million, a 374% increase over five and a half years. 

Automating its platform comes with another benefit -- juicy profit margins. Last year, Interactive Brokers's pretax margin was 67%, well above its peers in the financial sector. Its rapid growth and stellar profit margins are why Interactive Brokers's revenue and net income rose by 344% and 505%, respectively, since the start of 2017.

IBKR Revenue (TTM) Chart.

Data source: YCharts.

How it thrived while other financial stocks struggled

Some financial companies have struggled with the impact of higher interest rates. Since March 2022, the Federal Reserve has raised its benchmark interest rate from near zero to 5.50% -- the fastest pace of interest rate hikes in decades.

These rapid interest rate increases caught some off guard, notably SVB Financial's Silicon Valley Bank, which saw deposit outflows while it had huge unrealized losses on its securities investments.

One competitor, Charles Schwab, saw deposits decline 17% last year due to "cash sorting," when customers pulled funds and put them into higher interest-earning assets like savings accounts and money market funds. 

Interactive Brokers took a different approach -- paying higher interest rates on customers' uninvested cash balances. Currently, the broker pays customers 4.58% on any uninvested cash balances. Combine this with its ultra-low commission charges, and Interactive Brokers has become a popular broker among investors. Since the second quarter of last year, the broker has added 367,000 new accounts, up 19% year over year. 

While Interactive Brokers pays higher interest rates than competitors, it has also increased its net interest income (NII) at an impressive pace. In the second quarter, its NII of $694 million nearly doubled from the previous year and was a big driver of its 67% net income growth year over year. 

A person sits in front of a desk with a computer displaying stock price information.

Image source: Getty Images.

Interactive Brokers' stock trades at a reasonable valuation

Despite Interactive Brokers' strong stock performance the last year, the company trades near its lowest valuation in years. Its price-to-sales (P/S) ratio is 1.76, below its 10-year average of 1.85, while its price-to-earnings (P/E) ratio is near 17, well below its 10-year average of 36. 

Interactive Brokers generates high profit margins while benefiting from higher interest rates. It is well positioned to keep expanding, making this stock an excellent one to buy and hold long term.