Warren Buffett is a successful stock picker and his company, Berkshire Hathaway, has regularly outperformed the S&P 500 over multiple decades. Investors can learn a lot from his strategies, which center around value, competitive advantage, and a reasonable growth. Buffett usually looks for these attributes while searching for the wonderful businesses he invests in.

But it's not financial analysis or strong accounting knowledge that he thinks is the most important quality for an investor to have. You also don't need to be incredibly smart to be a successful investor. Instead, it all goes back to having the right mindset.

Buffett has said: "The most important quality for an investor is temperament, not intellect. You need a temperament that neither derives great pleasure from being with the crowd or against the crowd."

The gambling-parlor mentality led to some terrible buys

Buffett's business partner, Charlie Munger, previously compared the hyperactivity in the markets and speculation due to stock trading apps such as Robinhood with what you might expect to see in a casino. He refers to the app as a "gambling parlor."

The danger for investors is that getting caught up in all that excitement and bullishness can lead to too much optimism and buying at inflated prices. A good example is COVID-19 vaccine-maker Moderna (MRNA 1.69%).

The stock hit highs of around $500 in 2021. Today, it trades at about $160, and with COVID-19 revenue declining sharply this year, there's little hope of the healthcare stock getting back to those heights anytime soon as the company doesn't have any other approved products besides its mRNA-based vaccine. To get a glimpse of just how crazy Moderna's valuation had become, investors can look at Moderna's price-to-sales multiple over the past few years:

MRNA PS Ratio Chart
MRNA PS Ratio data by YCharts.

At more than 1,000 times revenue at its peak, the stock price had reached an unsustainable valuation. Even its average of 132 is far too high a premium to be paying for a company with such an uncertain future. 

While the business was showing some promise and generating a lot of revenue growth, it was a hefty premium for a business that was benefiting from demand for its vaccine during a public health emergency, which isn't a sustainable business model. Investors with the right temperament wouldn't have been shelling out so much money for a company with just a single product whose long-term demand was uncertain. Buffett values predictability in earnings, which Moderna still lacks today.

How investors can ensure they have the right temperament 

One of the things Buffett looks for in a business is being able to predict and forecast its profits. If a business has an uncertain future, that's generally not a Buffett-type stock. Berkshire's top holdings include companies that should remain profitable and are likely to continue growing, including AppleKraft Heinz, and Coca-Cola. They have strong brands in their portfolios with fairly little risk involved.

The problem with Moderna was that it wasn't a well-known company in 2020 and the development of its COVID-19 vaccine put the business on the map. The prospect of the company going from less than $50 million in sales in 2019 to generating billions in a short period led to a wildly soaring stock price. It was and still is, difficult to forecast the company's profitability and how it will perform in the future.

And the road ahead could be a tough one for the company. CEO Stéphane Bancel said last month that he expects demand for the company's COVID-19 vaccine to drop by 90%. While there is the potential for Moderna to develop other mRNA-based vaccines, making up for lost COVID-19 revenue will be no easy task -- last year's product sales totaled $18.4 billion. It could be years before the company is generating consistent profits, assuming it can do so at all. 

Investors should focus on the long term

Whether it's Moderna or other businesses whose future earnings are uncertain, it pays to be extra careful if these stocks are driven up by lots of speculation. When you're buying for the long haul, it's important to consider a company's prospects for profitability in not just the current year, but for the next five to 10 years.