I don't normally buy and sell stocks very often. I can sometimes go months without doing anything. The prospects of the businesses in my portfolio don't change on a day-to-day basis, so why should my portfolio? The more you trade, the worse you tend to do, in my opinion.

The beginning of the pandemic last year was a rare exception for me. I remember looking through my watch list every morning last March as the major stock indices swung 10% in either direction daily. Deals were everywhere. Between Feb. 25 and March 30, I placed 49 buy orders. That's nearly twice as many as I placed in all of 2019.

It felt bad buying stocks as the prices of those stocks tumbled. It always does. But boy has it paid off. I'm not a growth investor, so I didn't buy shares of the hottest pandemic stocks like Zoom and Peloton that benefited greatly from a year of lockdowns and restrictions. I instead invested in companies that would likely be hit hard by the pandemic, but whose stocks seemed severely mispriced. Pessimism created some incredible bargains last year.

Puzzle pieces spelling value.

Image source: Getty Images.

Two of my best pandemic investments, measured from the lowest price I paid, were automaker General Motors (GM 1.98%) and online bank Ally Financial (ALLY 1.77%). Both stocks were already in my portfolio when the pandemic began. And both stocks have produced incredible returns.

Nobody wanted to buy GM a year ago

Today, GM's electric vehicle plans have investors excited about the automaker's prospects. Last March, almost no one wanted to touch the industrial giant. Auto factories were shut down and production was temporarily halted. A deep economic depression seemed like a possible scenario at the time, so the idea of investing in a carmaker that had failed during the financial crisis a little more than decade ago wasn't enticing to most people.

But GM's balance sheet was much stronger going into the pandemic than it was going into the financial crisis. The company had around $23 billion of cash and securities at the end of 2019. The GM that emerged a decade ago was much leaner than the lumbering automaker of the past. That's one reason why I owned the stock in the first place.

I added to my GM position four times last March. Each time the price continued to sink. My last purchase was when GM traded at just $16.26 per share. GM trades just shy of $60 per share today. From that lowest point, my GM investment returned about 270% in a little over a year. For comparison, the S&P 500 is up about 90% from its pandemic low.

Is GM still a good investment today at a much higher price? I think so. The company is going all-in on electric vehicles, planning to launch 30 models globally by 2025. An electric version of its popular Chevy Silverado pickup truck is on the way. And despite the impact of the pandemic and the heavy investments in EVs and autonomous technology, GM is still producing plenty of profits.

GM stock trades for just 11.5 times the high end of its 2021 earnings guidance. This is a cyclical industry heavily dependent on economic conditions, but GM looks like a solid long-term investment to me.

Ally was unbelievably cheap

Ally, an online bank that derives most of its revenue from auto loans, was the financial arm of GM prior to the financial crisis. The company has been gaining deposits quickly over the past decade thanks to a strategy of offering high rates on its savings accounts.

Shares of Ally fell off a cliff last March. Fears that people would default on car loans amid the pandemic likely played a role. Just as I did with GM, I added to my Ally position four times in March. The lowest price I paid was $12.11 per share.

Ally stock was incredibly cheap back then. The price-to-book value dropped to 0.3 at one point, compared to typical values closer to 1. I knew that if Ally survived, and I was pretty sure it would, the stock would produce solid returns.

Ally not only survived, but it's thriving. The bank has 2.3 million deposit customers, nearly $130 billion in retail deposits, and it's producing record results. Ally has relationships with 19,000 auto dealers, and it's the top prime auto lender in the country. It's also the largest all-digital direct U.S. bank. On top of its auto lending business, Ally has a growing mortgage lending business.

At the current stock price of around $54 per share, my investment in Ally last year has returned nearly 350%.

There are many ways to invest

Pricey growth stocks performed well in 2020 as investors flocked to companies that could benefit from the pandemic. But that wasn't the only way to produce market-beating returns. Buying shares of solid companies that had been unfairly beaten down by pandemic pessimism, even if you expected those companies to do poorly in the short term, offered a different path to success. Another pandemic winner for me was Spirit Airlines, which was probably the last stock that many people would have wanted to buy last March.

No one knows which stocks will be the big winners of the post-pandemic era. But one thing I know for sure is that buying shares of high-quality companies at irrationally depressed prices will always be a winning strategy in the long run.