You don’t have to be a Wall Street analyst to get the message: Investors are betting that sales for these firms will rise as Americans prepare for an outbreak that government officials have stated is just a matter of time. Consumers contemplating a self-quarantine might want to have some of the products these companies make on hand, along with the medical masks that are already making a fashion statement from New York to Milan.

Betting on stress-hoarding of Mint Milanos may be a smart move. But the prices of other stocks also reflect the thinking of investors who have been dumping riskier investments in favor of longstanding safety plays.

MarketAxess, a bond trading platform, has slipped only slightly this week, making it a comparative overperformer. Investors are gobbling up government bonds: 10-year Treasury notes have surged in price — pushing yields, which move in the opposite direction, to panicky record lows.

Prices for gold, viewed by some as a store of value and a place nervous Chinese investors like to wait out a storm, have also risen. The gold miner Newmont Mining has had a great February: Its stock is up nearly 10 percent.

Fortunately, there is at least one stock that is up for optimistic reasons: Gilead Sciences, whose drug, remdesivir, is now in a clinical trial as a possible treatment for the virus. The pharmaceutical company’s share price has surged roughly 18 percent this month.

Stock investors tend to look on the bright side. In their worldview, the economy almost always grows. Profits rise. Share prices climb. And inevitably, they get richer.