It can be said that timing the market is a fool's errand, but a general rule I would use to determine if I should be buying or selling is to observe the general level of the market. This provides me with a feel of the overall sentiment and acts as a gauge of the level of optimism and pessimism present.

The COVID-19 pandemic has understandably caused a lot of panic and distress. The market has collapsed in record time as the economy grinds to a halt due to mall and store closures, while massive job losses mean that consumers are unlikely to be able to spend for quite some time. While it remains to be seen if the massive fiscal stimulus announced by the U.S. government can help to buffer businesses and rekindle growth again, investors are witnessing a collapse in valuations just four months into the new year.

The market today is trading at levels that make valuations very attractive if we are to consider a longer-term investment horizon. This makes it a wise time to accumulate stakes in these two companies.

Woman smiling while looking at mobile phone in her hand

Image source: Getty Images.

Apple

Apple (NASDAQ:AAPL) announced the closure of all retail stores outside of Greater China since March 13. The initial plan was to reopen these stores by March 27, depending on whether the pandemic had started to ease. 

However, as the outbreak shows no signs of abating, Apple now expects its stores to remain closed until at least early May. The company is also reportedly contemplating delaying its next major iPhone launch, which is typically scheduled for the fall. 

While Apple has yet to provide updated guidance on the financial effects of these store closures, investors should expect the hit to be significant. Not only will the tech giant report lost sales of iPhones, iPads, and wearables as stores remain shuttered, but people's propensity to spend will also be adversely affected with mounting job losses.

Apple's share price has dipped just 11% year to date, performing much better than the broader market. However, with more bad news around the corner as the company quantifies the effects of the coronavirus, there could be more opportunities to load up on the stock.

Starbucks

Starbucks (NASDAQ:SBUX) has responded to the pandemic with regular updates for investors, a demonstration of the company's responsiveness and candor. In early March, Starbucks announced that more than half of its stores in China were temporarily closed since Jan. 28. As the outbreak situation has improved significantly since then, more than 90% of the China stores are now open but under elevated safety protocols. 

On March 22, CEO Kevin Johnson announced the decision to close customer access to the cafes of all company-operated Starbucks across the U.S. and Canada and shift to a drive-thru operating model. The company recently updated stakeholders on the effects of COVID-19 on its second-quarter fiscal year 2020 earnings per share (EPS). Preliminary estimates are for EPS of $0.28, which would represent a year-over-year decline of 47% from $0.53. These estimates reflect not just the effects of lost sales, but also incremental expenses relating to partners' wages and benefits, store operations, and activities related to the outbreak. 

Though Starbucks is set to report sharply lower earnings when its next report is released April 28, this opens up a window of opportunity for investors to purchase shares, as earnings will be temporarily hit. I am confident that a combination of Starbucks's excellent management and strong digital flywheel program will enable the coffee chain to pick itself back up after the crisis abates.

Temporarily beaten down

These two quality names have been temporarily beaten down, thereby offering a chance for investors to accumulate their shares for the long term. Though there may continue to be nasty surprises springing up due to the ever-changing pandemic situation, there's probably no better time in the last decade to invest your money.