Domino's Pizza is the only restaurant stock that's trading positively year-to-date as investors bet that more consumers will stay home and order pizza delivery during the coronavirus outbreak.

The pizza chain's stock, which has a market value of $12.3 billion, is up nearly 8% so far in 2020. Shares of Starbucks and McDonald's have fallen in the double digits in the same period. Like many in the industry, both of those restaurants offer delivery through third-party providers like DoorDash and Uber Eats, but it is a small part of their overall U.S. sales.

"In this situation we're in, the delivery-based business is obviously a more favorable narrative relative to others in the restaurant industry," Cowen analyst Andrew Charles said in an interview.

Domino's has been investing in its delivery business for the last few years through its "fortressing" strategy. Under the strategy, stores are added to existing markets to be closer to customers, making deliveries faster and to increase driver tips. In the current environment, this could be an advantage. If one location has to be closed temporarily due to the virus, customers will likely still be able to receive delivery from other nearby locations.

Domino's shares surged 25% on Feb. 20 after the company's fourth-quarter earnings and U.S. same-store sales beat Wall Street's estimates. While the stock has lost some momentum since then, not all of its gains have been erased.

"That was something that was definitely needed for them. It was something that they hadn't really had over the past two quarters," Charles said.

But the pizza chain's stock could start to feel the pinch as sporting events are canceled. On Friday, shares were trading down about 4% before the market's open. Last year, Domino's offered half-off pizzas during March Madness, a promotion that helped the chain weather competition from third-party delivery providers in its first quarter. The annual NCAA basketball tournament has been canceled this year due to the pandemic.

Domino's stock losses on Friday came as the broader market rebounds from the worst day of trading since 1987.